Skip to content

Commit ffe52b2

Browse files
committed
[update] : Supported --debug in aur.sh
1 parent fb3285a commit ffe52b2

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

system/aur.sh

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,35 @@ function user_check () {
3939
fi
4040
}
4141

42+
_help() {
43+
echo "usage ${0} [option] [packages]"
44+
echo
45+
echo "Run yay in airootfs"
46+
echo
47+
echo " General options:"
48+
echo " -d Enable pacman debug"
49+
echo " -h This help message"
50+
}
51+
52+
while getopts "dh" arg; do
53+
case ${arg} in
54+
d)
55+
pacman_debug=true
56+
;;
57+
h)
58+
_help
59+
exit 0
60+
;;
61+
*)
62+
_help
63+
exit 1
64+
;;
65+
esac
66+
done
67+
68+
shift $((OPTIND - 1))
69+
70+
4271
# Creating a aur user.
4372
if [[ $(user_check ${aur_username}) = false ]]; then
4473
useradd -m -d "/aurbuild_temp" "${aur_username}"
@@ -67,10 +96,14 @@ yes | sudo -u aurbuild \
6796
--noupgrademenu \
6897
--noprovides \
6998
--removemake \
99+
$(
100+
if [[ "${pacman_debug}" = true ]]; then
101+
echo -n "--debug"
102+
fi
103+
) \
70104
--config "/etc/alteriso-pacman.conf" \
71105
${*}
72106

73-
74107
# remove user and file
75108
userdel aurbuild
76109
remove /aurbuild_temp

0 commit comments

Comments
 (0)