diff options
author | Dan McGee <dan@archlinux.org> | 2009-09-13 18:16:55 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-09-13 18:16:55 -0500 |
commit | 2afa1063284a25ae2691b2727c45238d15025a9a (patch) | |
tree | 8e6a65fc6af6feb60652ff177b4cc95e4bf8185f | |
parent | 5ebf55bedfa891a80170facc79f2fbfca11983c4 (diff) |
Be more careful with config file inclusion
We can't really do the basedir magic from db-functions as it is just being
sourced and is not the currently executing script. Although a bit
repetitive, it is a lot safer to just include the config file everywhere.
Noticed this when trying to run the latest available scripts on sigurd.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rwxr-xr-x | convert-to-any | 1 | ||||
-rwxr-xr-x | cron-jobs/createFileLists | 1 | ||||
-rwxr-xr-x | cron-jobs/sourceballs | 1 | ||||
-rw-r--r-- | db-functions | 8 | ||||
-rwxr-xr-x | db-move | 1 | ||||
-rwxr-xr-x | db-remove | 1 | ||||
-rwxr-xr-x | db-update | 1 | ||||
-rwxr-xr-x | misc-scripts/ftpdir-cleanup | 1 | ||||
-rwxr-xr-x | misc-scripts/make-sourceball | 1 | ||||
-rwxr-xr-x | testing2x | 1 |
10 files changed, 9 insertions, 8 deletions
diff --git a/convert-to-any b/convert-to-any index e21b7cd..53d1a7b 100755 --- a/convert-to-any +++ b/convert-to-any @@ -16,6 +16,7 @@ if [ $# -ne 1 ]; then fi . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" cleanup() { trap '' 0 2 diff --git a/cron-jobs/createFileLists b/cron-jobs/createFileLists index 345f9aa..d936853 100755 --- a/cron-jobs/createFileLists +++ b/cron-jobs/createFileLists @@ -5,6 +5,7 @@ targetdir=$reposdir repos="core extra testing community" . "$(dirname $0)/../db-functions" +. "$(dirname $0)/../config" if [ -f "/tmp/createFileList.lock" ]; then echo "Error: createFileList allready in progress." diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index aa06aff..46c2fa3 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -5,6 +5,7 @@ srcbase="/srv/ftp/sources" repos="core extra testing community" . "$(dirname $0)/../db-functions" +. "$(dirname $0)/../config" LOCKFILE="/tmp/.sourceball.lock" diff --git a/db-functions b/db-functions index ccab830..071fb85 100644 --- a/db-functions +++ b/db-functions @@ -3,14 +3,6 @@ # Random integrity things [ "$UID" = "" ] && UID=$(uid) -if [ -z "$BASEDIR" ]; then - BASEDIR="$(dirname $0)" -fi - -if [ -f "$BASEDIR/config" ]; then - . "$BASEDIR/config" -fi - # Useful functions UMASK="" @@ -6,6 +6,7 @@ if [ $# -ne 4 ]; then fi . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" packagebase="$1" repofrom="$2" @@ -6,6 +6,7 @@ if [ $# -ne 3 ]; then fi . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" packagebase="$1" reponame="$2" @@ -6,6 +6,7 @@ if [ $# -ne 1 ]; then fi . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" reponame="$1" current_arch="" diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup index 96407c0..9349bca 100755 --- a/misc-scripts/ftpdir-cleanup +++ b/misc-scripts/ftpdir-cleanup @@ -11,6 +11,7 @@ dest=$2 ############################################################ . "$(dirname $0)/../db-functions" +. "$(dirname $0)/../config" getpkgname() { local tmp diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball index 9f565f7..f2d8415 100755 --- a/misc-scripts/make-sourceball +++ b/misc-scripts/make-sourceball @@ -10,6 +10,7 @@ if [ $# -ne 3 -a $# -ne 4 ]; then fi . "$(dirname $0)/../db-functions" +. "$(dirname $0)/../config" FORCE=0 if [ "$1" = "-f" ]; then @@ -1,6 +1,7 @@ #!/bin/bash . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" case "$0" in *64) |