Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/checkpkg.in
diff options
context:
space:
mode:
Diffstat (limited to 'checkpkg.in')
-rw-r--r--checkpkg.in19
1 files changed, 11 insertions, 8 deletions
diff --git a/checkpkg.in b/checkpkg.in
index 6904e32..cfec71e 100644
--- a/checkpkg.in
+++ b/checkpkg.in
@@ -28,14 +28,19 @@ fi
# Source makepkg.conf; fail if it is not found
if [[ -r '/etc/makepkg.conf' ]]; then
+ # shellcheck source=makepkg-x86_64.conf
source '/etc/makepkg.conf'
else
die '/etc/makepkg.conf not found!'
fi
# Source user-specific makepkg.conf overrides
-if [[ -r ~/.makepkg.conf ]]; then
- source ~/.makepkg.conf
+if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" ]]; then
+ # shellcheck source=/dev/null
+ source "${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf"
+elif [[ -r "$HOME/.makepkg.conf" ]]; then
+ # shellcheck source=/dev/null
+ source "$HOME/.makepkg.conf"
fi
if [[ ! -f PKGBUILD ]]; then
@@ -44,8 +49,9 @@ if [[ ! -f PKGBUILD ]]; then
exit 1
fi
+# shellcheck source=PKGBUILD.proto
. ./PKGBUILD
-if [[ $arch == 'any' ]]; then
+if [[ ${arch[0]} == 'any' ]]; then
CARCH='any'
fi
@@ -60,15 +66,12 @@ for _pkgname in "${pkgname[@]}"; do
ln -s "$pkgfile" "$TEMPDIR"
- pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname")
-
- if [[ $? -ne 0 ]]; then
+ pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname") ||
die "Couldn't download previous package for %s." "$_pkgname"
- fi
oldpkg=${pkgurl##*://*/}
- if [[ ${oldpkg##*/} = ${pkgfile##*/} ]]; then
+ if [[ ${oldpkg##*/} = "${pkgfile##*/}" ]]; then
die "The built package (%s) is the one in the repo right now!" "$_pkgname"
fi