detached 5e6ac71

feat(repos): add AUR helper selection and improve yay installation error handling

commit
5e6ac715a8fa15d3b5e64e18fe375fe3f73d2335
author
bnema · · 2025-10-19 19:32 UTC
committer
bnema · · 2025-10-19 16:42 UTC
parent
54d5fb4
signature
unsigned
2 files · +49 -29
M install/repos/all.sh +23 -1
@@ -2,6 +2,28 @@
22 # Repository setup phase
33
44 stop_log_output # Stop for interactive prompts
5-source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm)
5+
6+# AUR Support prompt
7+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support"
8+echo
9+
10+if gum confirm "Enable AUR support?" --padding "0 0 1 $PADDING_LEFT"; then
11+ export ARCHUP_AUR="enabled"
12+
13+ # Choose AUR helper
14+ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Choose AUR Helper"
15+ AUR_HELPER=$(gum choose --cursor.foreground 6 --padding "0 0 1 $PADDING_LEFT" "paru" "yay")
16+
17+ if [ "$AUR_HELPER" = "paru" ]; then
18+ source "$ARCHUP_INSTALL/repos/paru.sh"
19+ else
20+ source "$ARCHUP_INSTALL/repos/yay.sh"
21+ fi
22+else
23+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
24+ echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
25+ export ARCHUP_AUR="disabled"
26+fi
27+
628 source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)
729 start_log_output # Resume (will be stopped by stop_install_log)
@@ -2,6 +2,28 @@
2 # Repository setup phase2 # Repository setup phase
3 3
4 stop_log_output # Stop for interactive prompts4 stop_log_output # Stop for interactive prompts
5-source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm)5+
6+# AUR Support prompt
7+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support"
8+echo
9+
10+if gum confirm "Enable AUR support?" --padding "0 0 1 $PADDING_LEFT"; then
11+ export ARCHUP_AUR="enabled"
12+
13+ # Choose AUR helper
14+ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Choose AUR Helper"
15+ AUR_HELPER=$(gum choose --cursor.foreground 6 --padding "0 0 1 $PADDING_LEFT" "paru" "yay")
16+
17+ if [ "$AUR_HELPER" = "paru" ]; then
18+ source "$ARCHUP_INSTALL/repos/paru.sh"
19+ else
20+ source "$ARCHUP_INSTALL/repos/yay.sh"
21+ fi
22+else
23+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
24+ echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
25+ export ARCHUP_AUR="disabled"
26+fi
27+
6 source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)28 source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)
7 start_log_output # Resume (will be stopped by stop_install_log)29 start_log_output # Resume (will be stopped by stop_install_log)
M install/repos/yay.sh +26 -28
@@ -1,20 +1,7 @@
11 #!/bin/bash
22 # Install yay AUR helper
33
4-gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support"
5-echo
6-
7-# Ask if user wants AUR support
8-if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then
9- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
10- echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
11- export ARCHUP_AUR="disabled"
12- return 0
13-fi
14-
15-export ARCHUP_AUR="enabled"
16-
17-gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay AUR helper..."
4+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay..."
185 gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..."
196
207 # Install base-devel if not already installed (required for building AUR packages)
@@ -23,29 +10,40 @@ arch-chroot /mnt pacman -S --noconfirm --needed base-devel git >> "$ARCHUP_INSTA
2310 # Get the username created during installation
2411 USERNAME=$(arch-chroot /mnt ls /home | head -1)
2512
26-if [ -z "$USERNAME" ]; then
27- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Error: Could not find user for yay installation"
13+if [[ -z "${USERNAME}" ]]; then
14+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Could not find user for yay installation"
2815 echo "ERROR: No user found for yay installation" >> "$ARCHUP_INSTALL_LOG_FILE"
2916 export ARCHUP_AUR="failed"
3017 return 1
3118 fi
3219
33-# Clone yay-bin from AUR as the user (not root)
34-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
35-
36-# Build and install yay as the user
37-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
38-
39-# Clean up
40-arch-chroot /mnt rm -rf /tmp/yay-bin >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
20+# Build yay as user and install as root
21+echo "Building yay package..." >> "$ARCHUP_INSTALL_LOG_FILE"
22+if ! arch-chroot /mnt bash <<CHROOT_SCRIPT >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
23+set -e
24+set -u
25+set -o pipefail
26+cd /tmp
27+su ${USERNAME} -c "git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -s --noconfirm"
28+cd yay-bin
29+pacman -U --noconfirm yay-bin-*.pkg.tar.zst
30+cd /tmp
31+rm -rf yay-bin
32+CHROOT_SCRIPT
33+then
34+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"
35+ echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE"
36+ export ARCHUP_AUR="failed"
37+ return 1
38+fi
4139
4240 # Verify installation
43-if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then
41+if arch-chroot /mnt su - "${USERNAME}" -c "yay --version" >/dev/null 2>&1; then
4442 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully"
45- echo "AUR: enabled (yay installed for user: $USERNAME)" >> "$ARCHUP_INSTALL_LOG_FILE"
43+ echo "AUR: enabled (yay installed for user: ${USERNAME})" >> "$ARCHUP_INSTALL_LOG_FILE"
4644 else
47- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"
48- echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE"
45+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay verification failed"
46+ echo "ERROR: yay verification failed" >> "$ARCHUP_INSTALL_LOG_FILE"
4947 export ARCHUP_AUR="failed"
5048 return 1
5149 fi
@@ -1,20 +1,7 @@
1 #!/bin/bash1 #!/bin/bash
2 # Install yay AUR helper2 # Install yay AUR helper
3 3
4-gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support"4+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay..."
5-echo
6-
7-# Ask if user wants AUR support
8-if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then
9- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
10- echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
11- export ARCHUP_AUR="disabled"
12- return 0
13-fi
14-
15-export ARCHUP_AUR="enabled"
16-
17-gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay AUR helper..."
18 gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..."5 gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..."
19 6
20 # Install base-devel if not already installed (required for building AUR packages)7 # Install base-devel if not already installed (required for building AUR packages)
@@ -23,29 +10,40 @@ arch-chroot /mnt pacman -S --noconfirm --needed base-devel git >> "$ARCHUP_INSTA
23 # Get the username created during installation10 # Get the username created during installation
24 USERNAME=$(arch-chroot /mnt ls /home | head -1)11 USERNAME=$(arch-chroot /mnt ls /home | head -1)
25 12
26-if [ -z "$USERNAME" ]; then13+if [[ -z "${USERNAME}" ]]; then
27- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Error: Could not find user for yay installation"14+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Could not find user for yay installation"
28 echo "ERROR: No user found for yay installation" >> "$ARCHUP_INSTALL_LOG_FILE"15 echo "ERROR: No user found for yay installation" >> "$ARCHUP_INSTALL_LOG_FILE"
29 export ARCHUP_AUR="failed"16 export ARCHUP_AUR="failed"
30 return 117 return 1
31 fi18 fi
32 19
33-# Clone yay-bin from AUR as the user (not root)20+# Build yay as user and install as root
34-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true21+echo "Building yay package..." >> "$ARCHUP_INSTALL_LOG_FILE"
35-22+if ! arch-chroot /mnt bash <<CHROOT_SCRIPT >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
36-# Build and install yay as the user23+set -e
37-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true24+set -u
38-25+set -o pipefail
39-# Clean up26+cd /tmp
40-arch-chroot /mnt rm -rf /tmp/yay-bin >> "$ARCHUP_INSTALL_LOG_FILE" 2>&127+su ${USERNAME} -c "git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -s --noconfirm"
28+cd yay-bin
29+pacman -U --noconfirm yay-bin-*.pkg.tar.zst
30+cd /tmp
31+rm -rf yay-bin
32+CHROOT_SCRIPT
33+then
34+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"
35+ echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE"
36+ export ARCHUP_AUR="failed"
37+ return 1
38+fi
41 39
42 # Verify installation40 # Verify installation
43-if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then41+if arch-chroot /mnt su - "${USERNAME}" -c "yay --version" >/dev/null 2>&1; then
44 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully"42 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully"
45- echo "AUR: enabled (yay installed for user: $USERNAME)" >> "$ARCHUP_INSTALL_LOG_FILE"43+ echo "AUR: enabled (yay installed for user: ${USERNAME})" >> "$ARCHUP_INSTALL_LOG_FILE"
46 else44 else
47- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"45+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay verification failed"
48- echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE"46+ echo "ERROR: yay verification failed" >> "$ARCHUP_INSTALL_LOG_FILE"
49 export ARCHUP_AUR="failed"47 export ARCHUP_AUR="failed"
50 return 148 return 1
51 fi49 fi

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close