Automatically search and install AUR dependencies
This commit is contained in:
parent
99421564ec
commit
a466636968
31
pkgbuild.sh
31
pkgbuild.sh
|
@ -7,23 +7,27 @@ setPermissions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
installAurDeps() {
|
installAurDeps() {
|
||||||
if [ -n "$aurDeps" ] && [ "$aurDeps" = true ]; then
|
aurPkgs=()
|
||||||
|
sudo -u nobody makepkg --printsrcinfo > .SRCINFO
|
||||||
|
regExp="^[[:space:]]*\(make\)\?depends\(.\)* = \([[:alnum:][:punct:]]*\)[[:space:]]*$"
|
||||||
|
mapfile -t pkgDeps < <(sed -n -e "s/$regExp/\3/p" .SRCINFO)
|
||||||
|
for pkgDep in "${pkgDeps[@]}"; do
|
||||||
|
pkgName=$(echo "$pkgDep" | sed 's/[><=].*//')
|
||||||
|
set +e
|
||||||
|
pkgInfo=$(paru -Ss "${pkgName}" 2> /dev/null)
|
||||||
|
set -e
|
||||||
|
if ! echo "$pkgInfo" | grep "\/${pkgName} "; then
|
||||||
|
aurPkgs+=("$pkgName")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ "${#aurPkgs[@]}" -gt 0 ]; then
|
||||||
pacman -S --noconfirm --needed git
|
pacman -S --noconfirm --needed git
|
||||||
git clone https://aur.archlinux.org/paru-bin.git
|
git clone https://aur.archlinux.org/paru-bin.git
|
||||||
cd paru-bin; sudo -u nobody makepkg -si --noconfirm; cd ..
|
cd paru-bin; sudo -u nobody makepkg -si --noconfirm; cd ..
|
||||||
sudo -u nobody makepkg --printsrcinfo > .SRCINFO
|
for aurPkg in "${aurPkgs[@]}"; do
|
||||||
regExp="^[[:space:]]*\(make\)\?depends\(.\)* = \([[:alnum:][:punct:]]*\)[[:space:]]*$"
|
paru -S --noconfirm "$aurPkg"
|
||||||
mapfile -t pkgDeps < <(sed -n -e "s/$regExp/\3/p" .SRCINFO)
|
|
||||||
for pkgDep in "${pkgDeps[@]}"; do
|
|
||||||
pkgName=$(echo "$pkgDep" | sed 's/[><=].*//')
|
|
||||||
set +e
|
|
||||||
pkgInfo=$(paru -Ss "${pkgName}" 2> /dev/null | grep "\/${pkgName} ")
|
|
||||||
set -e
|
|
||||||
if echo "$pkgInfo" | grep -q "^aur\/"; then
|
|
||||||
paru -S --noconfirm "$pkgName"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
rm -rf paru-bin .SRCINFO
|
rm -rf paru-bin
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +96,6 @@ getInputs() {
|
||||||
gpgPublicKey="$INPUT_GPGPUBLICKEY"
|
gpgPublicKey="$INPUT_GPGPUBLICKEY"
|
||||||
gpgPassphrase="$INPUT_GPGPASSPHRASE"
|
gpgPassphrase="$INPUT_GPGPASSPHRASE"
|
||||||
pkgDir="$INPUT_PKGDIR"
|
pkgDir="$INPUT_PKGDIR"
|
||||||
aurDeps="$INPUT_AURDEPS"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
runScript() {
|
runScript() {
|
||||||
|
|
Loading…
Reference in New Issue