From 2afa1063284a25ae2691b2727c45238d15025a9a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 13 Sep 2009 18:16:55 -0500 Subject: 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 --- convert-to-any | 1 + cron-jobs/createFileLists | 1 + cron-jobs/sourceballs | 1 + db-functions | 8 -------- db-move | 1 + db-remove | 1 + db-update | 1 + misc-scripts/ftpdir-cleanup | 1 + misc-scripts/make-sourceball | 1 + 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="" diff --git a/db-move b/db-move index b49aeda..efd54e0 100755 --- a/db-move +++ b/db-move @@ -6,6 +6,7 @@ if [ $# -ne 4 ]; then fi . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" packagebase="$1" repofrom="$2" diff --git a/db-remove b/db-remove index 3ba7dd7..3190231 100755 --- a/db-remove +++ b/db-remove @@ -6,6 +6,7 @@ if [ $# -ne 3 ]; then fi . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" packagebase="$1" reponame="$2" diff --git a/db-update b/db-update index 7ff48ba..577a028 100755 --- a/db-update +++ b/db-update @@ -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 diff --git a/testing2x b/testing2x index f3b256b..f9ded9e 100755 --- a/testing2x +++ b/testing2x @@ -1,6 +1,7 @@ #!/bin/bash . "$(dirname $0)/db-functions" +. "$(dirname $0)/config" case "$0" in *64) -- cgit v1.2.3-24-g4f1b