Do away with the LOGDIR variable

The revision removes LOGDIR from sbopkg, sbopkg.conf.new, and
sbopkg.conf(5) and adds the previously missing LOGFILE value to
sbopkg.conf(5). Now, with a test for a setting to absolute path, we use
the dirname of LOGFILE rather than LOGDIR.
This commit is contained in:
slakmagik 2010-06-02 23:05:19 +00:00
parent 123b3799bc
commit b555c36c94
3 changed files with 13 additions and 9 deletions

View File

@ -8,7 +8,6 @@
# be exported, if desired.
# Directory variables
REPO_ROOT=${REPO_ROOT:-/var/lib/sbopkg}
LOGDIR=${LOGDIR:-/var/log/sbopkg}
QUEUEDIR=${QUEUEDIR:-/var/lib/sbopkg/queues}
SRCDIR=${SRCDIR:-/var/cache/sbopkg}
SBOPKGTMP=${SBOPKGTMP:-/tmp/sbopkg}
@ -16,7 +15,7 @@ SBOPKGTMP=${SBOPKGTMP:-/tmp/sbopkg}
REPO_NAME=${REPO_NAME:-SBo}
REPO_BRANCH=${REPO_BRANCH:-13.1}
KEEPLOG=YES
LOGFILE=$LOGDIR/sbopkg-build-log
LOGFILE=${LOGFILE:-/var/log/sbopkg/sbopkg-build-log}
DEBUG=0
CLEANUP=NO
MKDIR_PROMPT=YES

View File

@ -123,13 +123,13 @@ The default assignment is:
\fCKEEPLOG=YES\fP
.\"---------------------------------------------------------------------
.TP
.B LOGDIR
This option sets the location for the sbopkg permanent log if KEEPLOG is
set to YES.
.B LOGFILE
This option (which must be set to a full path) sets the name for the
build log if KEEPLOG is set to YES.
.IP
The default assignment is:
.IP
\fCLOGDIR=${LOGDIR:-/var/log/sbopkg}\fP
\fCLOGFILE=${LOGFILE:-/var/log/sbopkg/sbopkg-build-log}\fP
.\"---------------------------------------------------------------------
.TP
.B MKDIR_PROMPT

View File

@ -104,7 +104,7 @@ config_check() {
[[ -e $HOME/.sbopkg.conf ]] && . $HOME/.sbopkg.conf
# Some configuration options are mandatory
for VAR in REPO_ROOT LOGDIR QUEUEDIR SRCDIR SBOPKGTMP REPO_NAME \
for VAR in REPO_ROOT QUEUEDIR SRCDIR SBOPKGTMP REPO_NAME \
REPO_BRANCH KEEPLOG CLEANUP LOGFILE DEBUG TMP OUTPUT RSYNCFLAGS \
WGETFLAGS DIFF DIFFOPTS SBOPKG_REPOS_D ALLOW_MULTI; do
if [[ -z "${!VAR}" ]]; then
@ -134,6 +134,11 @@ EOF
exit 1
fi
if [[ $LOGFILE != /* ]]; then
echo "The LOGFILE variable must be set to a full path." 1>&2
exit 1
fi
# Convert some YES/NO variables into 'set/unset' ones.
yesno_to_setunset KEEPLOG
yesno_to_setunset CLEANUP
@ -329,8 +334,8 @@ directory_checks() {
ck_dir $REPO_DIR \
"Creating local repository directory $REPO_DIR for the \
script mirror."
ck_dir $LOGDIR \
"Creating log directory $LOGDIR."
ck_dir ${LOGFILE%/*} \
"Creating log directory ${LOGFILE%/*}."
ck_dir $QUEUEDIR \
"Creating queues directory $QUEUEDIR."
ck_dir $SRCDIR \