Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
picodotdev committed Jan 5, 2022
1 parent 3d6d529 commit c376b15
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 39 deletions.
2 changes: 2 additions & 0 deletions alis-packages.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## Arch Linux packages to install
## more at https://www.archlinux.org/packages/
## PACKAGES_PACMAN_PIPEWIRE installing pipewire-pulse package requires to execute the following command after installation
### systemctl enable --user pipewire-pulse.service
PACKAGES_PACMAN_INSTALL="true"
PACKAGES_PACMAN_INSTALL_PIPEWIRE="false"
PACKAGES_PACMAN_INTERNET="!firefox !chromium !curl !wget !filezilla !sshfs !openssh !transmission-gtk !transmission-qt !liferea !gnome-boxes !gnome-tweaks"
Expand Down
53 changes: 31 additions & 22 deletions alis-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ function packages_pacman() {
pacman_uninstall "pulseaudio pulseaudio-bluetooth"
fi
pacman_install "$PACKAGES_PACMAN_PIPEWIRE"
if [ -n "$(echo "$PACKAGES_PACMAN_PIPEWIRE" | grep -F -w "pipewire-pulse")" ]; then
execute_user "systemctl enable --user pipewire-pulse.service"
fi
#if [ -n "$(echo "$PACKAGES_PACMAN_PIPEWIRE" | grep -F -w "pipewire-pulse")" ]; then
# execute_user "systemctl enable --user pipewire-pulse.service"
#fi
fi
fi
}
Expand Down Expand Up @@ -264,7 +264,7 @@ function packages_aur() {
execute_aur "rm -rf /home/$USER_NAME/.alis/aur/$COMMAND && mkdir -p /home/$USER_NAME/.alis/aur && cd /home/$USER_NAME/.alis/aur && git clone https://aur.archlinux.org/$COMMAND.git && (cd $COMMAND && makepkg -si --noconfirm) && rm -rf /home/$USER_NAME/.alis/aur/$COMMAND"
done

case "${COMMANDS[0]]}" in
case "${COMMANDS[0]}" in
"aurman" )
AUR_COMMAND="aurman"
;;
Expand All @@ -288,38 +288,47 @@ function packages_aur() {
fi
}

function pacman_install() {
function pacman_uninstall() {
ERROR="true"
set +e
IFS=' ' PACKAGES=($1)
for VARIABLE in {1..5}
PACKAGES_UNINSTALL=()
for PACKAGE in "${PACKAGES[@]}"
do
COMMAND="pacman -Syu --noconfirm --needed ${PACKAGES[@]}"
execute_sudo "$COMMAND"
if [ $? == 0 ]; then
ERROR="false"
break
else
sleep 10
execute_user "pacman -Qi $PACKAGE > /dev/null 2>&1"
PACKAGE_INSTALLED=$?
if [ $PACKAGE_INSTALLED == 0 ]; then
PACKAGES_UNINSTALL+=("$PACKAGE")
fi
done
COMMAND="pacman -Rdd --noconfirm ${PACKAGES_UNINSTALL[@]}"
execute_sudo "$COMMAND"
if [ $? == 0 ]; then
ERROR="false"
else
sleep 10
fi
set -e
if [ "$ERROR" == "true" ]; then
exit 1
fi
}

function pacman_uninstall() {
function pacman_install() {
ERROR="true"
set +e
IFS=' ' PACKAGES=($1)
COMMAND="pacman -R --noconfirm ${PACKAGES[@]}"
execute_sudo "$COMMAND"
if [ $? == 0 ]; then
ERROR="false"
else
sleep 10
fi
for VARIABLE in {1..5}
do
COMMAND="pacman -Syu --noconfirm --needed ${PACKAGES[@]}"
execute_sudo "$COMMAND"
if [ $? == 0 ]; then
ERROR="false"
break
else
sleep 10
fi
done
set -e
if [ "$ERROR" == "true" ]; then
exit 1
Expand Down Expand Up @@ -445,7 +454,7 @@ function execute_sudo() {
if [ "$SYSTEM_INSTALLATION" == "true" ]; then
arch-chroot /mnt bash -c "$COMMAND"
else
bash -c "sudo $COMMAND"
sudo bash -c "$COMMAND"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion alis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LOG="false"
### Warning! all disk data will be lost, so backup existing data before.
### "custom" value allows to use a custom parted partition script.
### "manual" allows to specify which existing partitions are used for boot partition and root partition.
DEVICE="/dev/sda !/dev/nvme0n1 !/dev/mmcblk0" # sata nvme mmc (single)
DEVICE="/dev/sda !/dev/nvme0n1 !/dev/vda !/dev/mmcblk0" # sata nvme mmc (single)
DEVICE_TRIM="true"
LVM="false"
LUKS_PASSWORD=""
Expand Down
16 changes: 0 additions & 16 deletions alis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1803,22 +1803,6 @@ function pacman_install() {
fi
}

function pacman_uninstall() {
ERROR="true"
set +e
IFS=' ' PACKAGES=($1)
arch-chroot /mnt pacman -R --noconfirm ${PACKAGES[@]}
if [ $? == 0 ]; then
ERROR="false"
else
sleep 10
fi
set -e
if [ "$ERROR" == "true" ]; then
exit 1
fi
}

function copy_logs() {
ESCAPED_LUKS_PASSWORD=$(echo "${LUKS_PASSWORD}" | sed 's/[.[\*^$()+?{|]/[\\&]/g')
ESCAPED_ROOT_PASSWORD=$(echo "${ROOT_PASSWORD}" | sed 's/[.[\*^$()+?{|]/[\\&]/g')
Expand Down

0 comments on commit c376b15

Please sign in to comment.