1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

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>
This commit is contained in:
Andrew Fyfe 2007-04-02 00:55:01 +01:00 committed by Dan McGee
parent ea3a182dbf
commit 9c9e18ef32
6 changed files with 84 additions and 26 deletions

View File

@ -75,4 +75,16 @@ DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/gnome/{,share/}{info,doc,gtk-doc})
#-- Packager: name/email of the person or organization building packages #-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>" #PACKAGER="John Doe <john@doe.com>"
#########################################################################
# BUILDSCRIPT/EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
# doing.
#
BUILDSCRIPT="PKGBUILD"
PKGEXT=".pkg.tar.gz"
DB_COMPRESSION="gz"
DB_CHECKSUMS=(md5)
# vim: set ft=sh ts=2 sw=2 et: # vim: set ft=sh ts=2 sw=2 et:

View File

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

View File

@ -36,11 +36,16 @@ export TEXTDOMAINDIR
myver='3.0.0' myver='3.0.0'
startdir=$(pwd) startdir=$(pwd)
BUILDSCRIPT="PKGBUILD" # Only use ABSROOT if we haven't been passed a SRCROOT on the command line.
PKGEXT="pkg.tar.gz" if [ -z "$SRCROOT" ]; then
if [ -r /etc/abs/abs.conf ]; then
source "/etc/abs/abs.conf" source /etc/abs/abs.conf
SRCROOT="$ABSROOT" fi
if [ -r ~/.abs.conf ]; then
source ~/.abs.conf
fi
SRCROOT=$ABSROOT
fi
# Options # Options
CLEANUP=0 CLEANUP=0
@ -418,16 +423,16 @@ ARGLIST=$@
_PKGDEST=${PKGDEST} _PKGDEST=${PKGDEST}
_SRCDEST=${SRCDEST} _SRCDEST=${SRCDEST}
#Source makepkg.conf; fail if it is not found # Source makepkg.conf; fail if it is not found
if [ -f /etc/makepkg.conf ]; then if [ -r /etc/makepkg.conf ]; then
source /etc/makepkg.conf source /etc/makepkg.conf
else else
error "$(gettext "/etc/makepkg.conf not found. cannot continue")" error "$(gettext "/etc/makepkg.conf not found. cannot continue")"
exit 1 exit 1 # $E_CONFIG_ERROR # TODO: error codes
fi fi
#Source user-specific makepkg.conf overrides # Source user-specific makepkg.conf overrides
if [ -f ~/.makepkg.conf ]; then if [ -r ~/.makepkg.conf ]; then
source ~/.makepkg.conf source ~/.makepkg.conf
fi fi

View File

@ -23,9 +23,6 @@ myver='3.0.0'
FORCE=0 FORCE=0
REPO_DB_FILE="" REPO_DB_FILE=""
DB_COMPRESSION="gz" #TODO this is gross
DB_CHECKSUMS=(md5)
TMP_DIR="" TMP_DIR=""
# print usage instructions # print usage instructions
@ -224,6 +221,18 @@ if [ $# -lt 2 ]; then
exit 1 exit 1
fi 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
# main routine # main routine
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then
gstmpdir=$(mktemp -d /tmp/gensync.XXXXXXXXXX) || (\ gstmpdir=$(mktemp -d /tmp/gensync.XXXXXXXXXX) || (\

View File

@ -23,9 +23,6 @@ myver='3.0.0'
FORCE=0 FORCE=0
REPO_DB_FILE="" REPO_DB_FILE=""
DB_COMPRESSION="gz" #TODO this is gross
DB_CHECKSUMS=(md5)
TMP_DIR="" TMP_DIR=""
# print usage instructions # print usage instructions
@ -80,6 +77,18 @@ if [ $# -lt 2 ]; then
exit 1 exit 1
fi 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
# main routine # main routine
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then
gstmpdir=$(mktemp -d /tmp/gensync.XXXXXXXXXX) || (\ gstmpdir=$(mktemp -d /tmp/gensync.XXXXXXXXXX) || (\

View File

@ -23,6 +23,8 @@
myver='3.0.0' myver='3.0.0'
# functions
usage() { usage() {
echo "updatesync $myver" echo "updatesync $myver"
echo "usage: $0 <action> <destfile> <option> [package_directory]" echo "usage: $0 <action> <destfile> <option> [package_directory]"
@ -47,11 +49,6 @@ usage() {
exit 0 exit 0
} }
BUILDSCRIPT="PKGBUILD"
PKGEXT="pkg.tar.gz"
source /etc/makepkg.conf
error () { error () {
echo "==> ERROR: $*" >&2 echo "==> ERROR: $*" >&2
} }
@ -72,6 +69,8 @@ check_force () {
false false
} }
# PROGRAM START
if [ $# -lt 3 ]; then if [ $# -lt 3 ]; then
usage usage
exit 1 exit 1
@ -82,6 +81,18 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then
exit 0 exit 0
fi 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 if [ "$1" != "upd" -a "$1" != "del" ]; then
usage usage
exit 1 exit 1