diff options
author | Nezmer <git@nezmer.info> | 2010-10-12 02:23:16 +0300 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-10-11 20:29:22 -0500 |
commit | 05f0a28932c1acab7a9ddb58435d69626dad54da (patch) | |
tree | 86b901ee3ba6fc6ba6d7219de38e68d70d092742 /contrib/wget-xdelta.sh.in | |
parent | bce3c8efc7a2d187984aa0e7037307b99c217fd7 (diff) |
Use sysconfdir, localstatedir, BASH instead of hardcoded values
This applies to contrib/ files, our scripts, and the documentation.
Dan: fix 'make clean' in contrib/ directory.
Signed-off-by: Nezmer <git@nezmer.info>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'contrib/wget-xdelta.sh.in')
-rwxr-xr-x | contrib/wget-xdelta.sh.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/wget-xdelta.sh.in b/contrib/wget-xdelta.sh.in index 4656f4dd..caf0171e 100755 --- a/contrib/wget-xdelta.sh.in +++ b/contrib/wget-xdelta.sh.in @@ -1,7 +1,7 @@ -#!/bin/bash +#!@BASH@ -if [ -r "/etc/makepkg.conf" ]; then - source /etc/makepkg.conf +if [ -r "@sysconfdir@/makepkg.conf" ]; then + source @sysconfdir@/makepkg.conf else echo "wget-xdelta: Unable to find makepkg.conf" exit 1 @@ -30,11 +30,11 @@ new_version=$(echo $pkg_data | cut -d ' ' -f 2) base_url=${file_url%/*} # Look for the last version -for file in $(ls -r /var/cache/pacman/pkg/${pkgname}-*-*{,-$CARCH}$PKGEXT 2>/dev/null); do +for file in $(ls -r @localstatedir@/cache/pacman/pkg/${pkgname}-*-*{,-$CARCH}$PKGEXT 2>/dev/null); do [[ "$file" =~ "$CARCH" ]] && arch="-$CARCH" || arch="" check_version=$(echo $file | \ sed "s|^.*/${pkgname}-\([[:alnum:]_\.]*-[[:alnum:]_\.]*\)${arch}$PKGEXT$|\1|" | \ - grep -v "^/var/cache/pacman/pkg") + grep -v "^@localstatedir@/cache/pacman/pkg") [ "$check_version" = "" ] && continue |