Skip to content

Commit

Permalink
Parse all dependencies from .SRCINFO
Browse files Browse the repository at this point in the history
This way all dependencies (makedepends, depends, optdepends) are
installed.
  • Loading branch information
2m committed Jul 29, 2021
1 parent c136561 commit 8c7aafd
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,22 @@ command=$3
# of the same name as "pkgname", so this works well
# with "aurpublish" tool

if [[ ! -d $pkgname ]]; then
echo "$pkgname should be a directory."
pkgbuild_dir=$(readlink "$pkgname" -f) # nicely cleans up path, ie. ///dsq/dqsdsq/my-package//// -> /dsq/dqsdsq/my-package

if [[ ! -d $pkgbuild_dir ]]; then
echo "$pkgbuild_dir should be a directory."
exit 1
fi

if [[ ! -e $pkgname/PKGBUILD ]]; then
echo "$pkgname does not contain a PKGBUILD file."
if [[ ! -e $pkgbuild_dir/PKGBUILD ]]; then
echo "$pkgbuild_dir does not contain a PKGBUILD file."
exit 1
fi

pkgbuild_dir=$(readlink "$pkgname" -f) # nicely cleans up path, ie. ///dsq/dqsdsq/my-package//// -> /dsq/dqsdsq/my-package
if [[ ! -e $pkgbuild_dir/.SRCINFO ]]; then
echo "$pkgbuild_dir does not contain a .SRCINFO file."
exit 1
fi

getfacl -p -R "$pkgbuild_dir" /github/home > /tmp/arch-pkgbuild-builder-permissions.bak

Expand All @@ -44,14 +49,12 @@ echo "keyserver hkp://keyserver.ubuntu.com:80" | tee /github/home/.gnupg/gpg.con

cd "$pkgbuild_dir"

pkgname="$(basename "$pkgbuild_dir")" # keep quotes in case someone passes in a directory path with whitespaces...
pkgname=$(grep -E 'pkgname' .SRCINFO | sed -e 's/.*= //')

install_deps() {
# install make and regular package dependencies
grep -E 'depends|makedepends' PKGBUILD | \
grep -v optdepends | \
sed -e 's/.*depends=//' -e 's/ /\n/g' | \
tr -d "'" | tr -d "(" | tr -d ")" | \
# install all package dependencies
grep -E 'depends' .SRCINFO | \
sed -e 's/.*depends = //' -e 's/:.*//' | \
xargs yay -S --noconfirm
}

Expand All @@ -60,11 +63,11 @@ case $target in
namcap PKGBUILD
install_deps
makepkg --syncdeps --noconfirm
namcap "${pkgname}"-*

# shellcheck disable=SC1091
source /etc/makepkg.conf # get PKGEXT

namcap "${pkgname}"-*"${PKGEXT}"
pacman -Qip "${pkgname}"-*"${PKGEXT}"
pacman -Qlp "${pkgname}"-*"${PKGEXT}"
;;
Expand Down

0 comments on commit 8c7aafd

Please sign in to comment.