Skip to content

Commit f298ad5

Browse files
committed
[update] : Supported pacman debug
1 parent 7eef42f commit f298ad5

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

system/aur.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -e -u
1010

1111
aur_username="aurbuild"
1212
pacman_debug=true
13+
pacman_args=()
1314

1415
trap 'exit 1' 1 2 3 15
1516

@@ -72,18 +73,26 @@ pacman-key --populate
7273
# Un comment the mirror list.
7374
#sed -i "s/#Server/Server/g" "/etc/pacman.d/mirrorlist"
7475

76+
# Set pacman args
77+
pacman_args=("--config" "/etc/alteriso-pacman.conf" "--noconfirm")
78+
if [[ "${pacman_debug}" = true ]]; then
79+
pacman_args+=("--debug")
80+
fi
81+
7582
# Install yay
7683
if ! pacman -Qq yay 1> /dev/null 2>&1; then
7784
(
7885
_oldpwd="$(pwd)"
79-
pacman -Syy --noconfirm --config "/etc/alteriso-pacman.conf"
80-
pacman --noconfirm -S --asdeps --needed go --config "/etc/alteriso-pacman.conf"
86+
pacman -Syy "${pacman_args[@]}"
87+
pacman -S --asdeps --needed "${pacman_args[@]}" go
8188
sudo -u "${aur_username}" git clone "https://aur.archlinux.org/yay.git" "/tmp/yay"
8289
cd "/tmp/yay"
8390
sudo -u "${aur_username}" makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
84-
pacman --noconfirm --config "/etc/alteriso-pacman.conf" -U $(sudo -u "${aur_username}" makepkg --packagelist)
91+
for _pkg in $(sudo -u "${aur_username}" makepkg --packagelist); do
92+
pacman "${pacman_args[@]}" -U "${_pkg}"
93+
done
8594
cd ..
86-
rm -rf "/tmp/yay"
95+
remove "/tmp/yay"
8796
cd "${_oldpwd}"
8897
)
8998
fi
@@ -101,7 +110,6 @@ for _pkg in "${@}"; do
101110
yay -Sy \
102111
--mflags "-AcC" \
103112
--aur \
104-
--noconfirm \
105113
--nocleanmenu \
106114
--nodiffmenu \
107115
--noeditmenu \
@@ -111,7 +119,7 @@ for _pkg in "${@}"; do
111119
--useask \
112120
--color always \
113121
--mflags "--skippgpcheck" \
114-
--config "/etc/alteriso-pacman.conf" \
122+
"${pacman_args[@]}" \
115123
--cachedir "/var/cache/pacman/pkg/" \
116124
"${_pkg}"
117125

@@ -121,7 +129,7 @@ for _pkg in "${@}"; do
121129
fi
122130
done
123131

124-
yay -Sccc --noconfirm --config "/etc/alteriso-pacman.conf"
132+
yay -Sccc "${pacman_args[@]}"
125133

126134
# remove user and file
127135
userdel "${aur_username}"

system/pkgbuild.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -e
1010

1111
build_username="pkgbuild"
1212
pacman_debug=true
13+
pacman_args=()
1314

1415
_help() {
1516
echo "usage ${0} [option]"
@@ -92,8 +93,14 @@ pacman-key --populate
9293
# Un comment the mirror list.
9394
#sed -i "s/#Server/Server/g" "/etc/pacman.d/mirrorlist"
9495

96+
# Set pacman args
97+
pacman_args=("--config" "/etc/alteriso-pacman.conf" "--noconfirm")
98+
if [[ "${pacman_debug}" = true ]]; then
99+
pacman_args+=("--debug")
100+
fi
101+
95102
# Update datebase
96-
pacman -Syy --config "/etc/alteriso-pacman.conf"
103+
pacman -Syy "${pacman_args[@]}"
97104

98105
# Parse SRCINFO
99106
cd "${pkgbuild_dir}"
@@ -106,23 +113,23 @@ if (( "${#pkgbuild_dirs[@]}" != 0 )); then
106113
if (( ${#depends[@]} + ${#makedepends[@]} != 0 )); then
107114
for _pkg in ${depends[@]} ${makedepends[@]}; do
108115
if pacman -Ssq "${_pkg}" | grep -x "${_pkg}" 1> /dev/null; then
109-
pacman -S --config "/etc/alteriso-pacman.conf" --noconfirm --asdeps --needed "${_pkg}"
116+
pacman -S --asdeps --needed "${pacman_args[@]}" "${_pkg}"
110117
fi
111118
done
112119
fi
113120
run_user makepkg -fACcs --noconfirm --skippgpcheck
114121
for pkg in $(run_user makepkg -f --packagelist); do
115-
pacman --noconfirm --needed --config /etc/alteriso-pacman.conf -U "${pkg}"
122+
pacman --needed "${pacman_args[@]}" -U "${pkg}"
116123
done
117124
cd - >/dev/null
118125
done
119126
fi
120127

121128
if deletepkg=($(pacman -Qtdq)) && (( "${#deletepkg[@]}" != 0 )); then
122-
pacman -Rsnc --noconfirm "${deletepkg[@]}" --config "/etc/alteriso-pacman.conf"
129+
pacman -Rsnc "${deletepkg[@]}" "${pacman_args[@]}"
123130
fi
124131

125-
pacman -Sccc --noconfirm --config "/etc/alteriso-pacman.conf"
132+
pacman -Sccc "${pacman_args[@]}"
126133

127134
# remove user and file
128135
userdel "${build_username}"

0 commit comments

Comments
 (0)