Attempt to fix a few problems introduced by the new rsync flags by moving the flags into sbopkg.conf and allowing users to modify them manually. This means that the new TIMEOUT variable can go.

This commit is contained in:
chess.griffin 2008-10-27 22:17:50 +00:00
parent fc6f9f8eb3
commit c0d1e39c5e
2 changed files with 11 additions and 4 deletions

View File

@ -14,8 +14,15 @@ SRCDIR=${SRCDIR:-/var/cache/sbopkg}
export TMP=${TMP:-/tmp/SBo}
KEEPLOG=YES
TERMBUILD=NO
TIMEOUT=10
# The following variables are required and can be tweaked if desired, although
# most users should leave them alone. Note: rsync already uses --archive,
# --delete, and --exclude in the main sbopkg script so it is not recommended
# to add those flags here.
RSYNCFLAGS="--verbose --timeout=10"
WGETFLAGS="--continue --progress=bar --timeout=10 --tries=5"
# Optional - the $OUTPUT variable is used by SlackBuild scripts only
# and can be used to change the output location of compiled packages.
#export OUTPUT=${OUTPUT:-/tmp}

View File

@ -52,7 +52,7 @@ if [ ! -e $SBOPKG_CONF ]; then
exit 1
else
. $SBOPKG_CONF
for VAR in RSYNCMIRROR SLACKVER LOCALREPO SRCDIR TMP KEEPLOG TERMBUILD TIMEOUT; do
for VAR in RSYNCMIRROR SLACKVER LOCALREPO SRCDIR TMP KEEPLOG TERMBUILD RSYNCFLAGS WGETFLAGS; do
if [ -z "${!VAR}" ]; then
MISSING+="$VAR "
fi
@ -751,7 +751,7 @@ rsync_command () {
# This function holds the rsync command.
# We do not use -z as this causes heavy CPU load on the server
# and has very limited effect when most of the pull is .gz files.
/usr/bin/rsync -av --delete --contimeout=$TIMEOUT --exclude="*.sbopkg" \
/usr/bin/rsync --archive --delete --exclude="*.sbopkg" $RSYNCFLAGS \
$RSYNCMIRROR/$SLACKVER/ $LOCALREPO/$SLACKVER/
RSYNC_RETVAL=$?
rm -rf $TMP/sbopkg_rsync.lck
@ -926,7 +926,7 @@ if [ ! -e $PKGPATH/$SRCNAME ]; then
# when a user presses Control-C. Please see the comments
# above around line 530 when build_package is first called as
# well as the comments to the control_c function, below.
wget -c -t 5 -T $TIMEOUT --progress=bar $DOWNLOAD -O $DOWNLOADFILE >> $SBOPKGOUTPUT & echo $! >> $TMP/sbopkg-build.pid 2>>$SBOPKGOUTPUT
wget $WGETFLAGS $DOWNLOAD -O $DOWNLOADFILE >> $SBOPKGOUTPUT & echo $! >> $TMP/sbopkg-build.pid 2>>$SBOPKGOUTPUT
#( wget -c -t 5 -T $TIMEOUT --progress=bar $DOWNLOAD -O $DOWNLOADFILE >> $SBOPKGOUTPUT & echo $! >> $TMP/sbopkg-build.pid ) 2>>$SBOPKGOUTPUT
wait
cd -