@@ -17,17 +17,22 @@ command=$3
1717# of the same name as "pkgname", so this works well
1818# with "aurpublish" tool
1919
20- if [[ ! -d $pkgname ]]; then
21- echo " $pkgname should be a directory."
20+ pkgbuild_dir=$( readlink " $pkgname " -f) # nicely cleans up path, ie. ///dsq/dqsdsq/my-package//// -> /dsq/dqsdsq/my-package
21+
22+ if [[ ! -d $pkgbuild_dir ]]; then
23+ echo " $pkgbuild_dir should be a directory."
2224 exit 1
2325fi
2426
25- if [[ ! -e $pkgname /PKGBUILD ]]; then
26- echo " $pkgname does not contain a PKGBUILD file."
27+ if [[ ! -e $pkgbuild_dir /PKGBUILD ]]; then
28+ echo " $pkgbuild_dir does not contain a PKGBUILD file."
2729 exit 1
2830fi
2931
30- pkgbuild_dir=$( readlink " $pkgname " -f) # nicely cleans up path, ie. ///dsq/dqsdsq/my-package//// -> /dsq/dqsdsq/my-package
32+ if [[ ! -e $pkgbuild_dir /.SRCINFO ]]; then
33+ echo " $pkgbuild_dir does not contain a .SRCINFO file."
34+ exit 1
35+ fi
3136
3237getfacl -p -R " $pkgbuild_dir " /github/home > /tmp/arch-pkgbuild-builder-permissions.bak
3338
@@ -44,14 +49,12 @@ echo "keyserver hkp://keyserver.ubuntu.com:80" | tee /github/home/.gnupg/gpg.con
4449
4550cd " $pkgbuild_dir "
4651
47- pkgname=" $( basename " $pkgbuild_dir " ) " # keep quotes in case someone passes in a directory path with whitespaces...
52+ pkgname=$( grep -E ' pkgname ' .SRCINFO | sed -e ' s/.*= // ' )
4853
4954install_deps () {
50- # install make and regular package dependencies
51- grep -E ' depends|makedepends' PKGBUILD | \
52- grep -v optdepends | \
53- sed -e ' s/.*depends=//' -e ' s/ /\n/g' | \
54- tr -d " '" | tr -d " (" | tr -d " )" | \
55+ # install all package dependencies
56+ grep -E ' depends' .SRCINFO | \
57+ sed -e ' s/.*depends = //' -e ' s/:.*//' | \
5558 xargs yay -S --noconfirm
5659}
5760
@@ -60,11 +63,11 @@ case $target in
6063 namcap PKGBUILD
6164 install_deps
6265 makepkg --syncdeps --noconfirm
63- namcap " ${pkgname} " -*
6466
6567 # shellcheck disable=SC1091
6668 source /etc/makepkg.conf # get PKGEXT
6769
70+ namcap " ${pkgname} " -* " ${PKGEXT} "
6871 pacman -Qip " ${pkgname} " -* " ${PKGEXT} "
6972 pacman -Qlp " ${pkgname} " -* " ${PKGEXT} "
7073 ;;
0 commit comments