From 9c9e18ef32c0cf3fe33ed251d28c70651bb85f65 Mon Sep 17 00:00:00 2001
From: Andrew Fyfe <andrew@neptune-one.net>
Date: Mon, 2 Apr 2007 00:55:01 +0100
Subject: 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>
---
 scripts/gensync | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

(limited to 'scripts/gensync')

diff --git a/scripts/gensync b/scripts/gensync
index 5a3dab88..f99cf597 100755
--- a/scripts/gensync
+++ b/scripts/gensync
@@ -22,6 +22,8 @@
 
 myver='3.0.0'
 
+# functions
+
 usage() {
 	echo "gensync $myver"
 	echo "usage: $0 <root> <destfile> [package_directory]"
@@ -45,11 +47,6 @@ usage() {
 	exit 0
 }
 
-BUILDSCRIPT="PKGBUILD"
-PKGEXT="pkg.tar.gz" 
-
-source /etc/makepkg.conf
-
 error () {
 	echo "==> ERROR: $*" >&2
 }
@@ -70,6 +67,8 @@ check_force () {
 	false
 }
 
+# PROGRAM START
+
 if [ $# -lt 2 ]; then
 	usage
 	exit 1
@@ -80,6 +79,19 @@ 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
+
+
 d=$(dirname $1)
 rootdir="$(cd $d && pwd)/$(basename $1)"
 d="$(dirname $2)"
-- 
cgit v1.2.3-70-g09d2