summaryrefslogtreecommitdiffstats
path: root/scripts/updatesync
diff options
context:
space:
mode:
authorAndrew Fyfe <andrew@neptune-one.net>2007-04-02 01:55:01 +0200
committerDan McGee <dan@archlinux.org>2007-04-02 03:52:28 +0200
commit9c9e18ef32c0cf3fe33ed251d28c70651bb85f65 (patch)
treee5f0dced39295c5e8a22b0a170d82b8d2bba0af1 /scripts/updatesync
parentea3a182dbfed4975eb5f2950b1c66bef53707f9a (diff)
downloadpacman-9c9e18ef32c0cf3fe33ed251d28c70651bb85f65.tar.gz
pacman-9c9e18ef32c0cf3fe33ed251d28c70651bb85f65.tar.xz
Tidy up usage of makepkg.conf
Moved the following variables into /etc/makepkg.conf * BUILDSCRIPT * PKGEXT * DB_COMPRESSION * DB_CHECKSUMS Cleaned up sourcing of /etc/makepkg.conf in scripts and source ~/.makepkg.conf if it exists. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/updatesync')
-rwxr-xr-xscripts/updatesync21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/updatesync b/scripts/updatesync
index a4a6847f..7c6dab27 100755
--- a/scripts/updatesync
+++ b/scripts/updatesync
@@ -23,6 +23,8 @@
myver='3.0.0'
+# functions
+
usage() {
echo "updatesync $myver"
echo "usage: $0 <action> <destfile> <option> [package_directory]"
@@ -47,11 +49,6 @@ usage() {
exit 0
}
-BUILDSCRIPT="PKGBUILD"
-PKGEXT="pkg.tar.gz"
-
-source /etc/makepkg.conf
-
error () {
echo "==> ERROR: $*" >&2
}
@@ -72,6 +69,8 @@ check_force () {
false
}
+# PROGRAM START
+
if [ $# -lt 3 ]; then
usage
exit 1
@@ -82,6 +81,18 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then
exit 0
fi
+# source system and user makepkg.conf
+if [ -r /etc/makepkg.conf ]; then
+ source /etc/makepkg.conf
+else
+ echo "ERROR: /etc/makepkg.conf not found. Can not continue." >&2
+ exit 1 # $E_CONFIG_ERROR # TODO: error codes
+fi
+
+if [ -r ~/.makepkg.conf ]; then
+ source ~/.makepkg.conf
+fi
+
if [ "$1" != "upd" -a "$1" != "del" ]; then
usage
exit 1