From c0d1e39c5edad0e3fb7f222dea656a93f5523480 Mon Sep 17 00:00:00 2001 From: "chess.griffin" Date: Mon, 27 Oct 2008 22:17:50 +0000 Subject: [PATCH] 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. --- src/etc/sbopkg/sbopkg.conf.new | 9 ++++++++- src/usr/bin/sbopkg | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/etc/sbopkg/sbopkg.conf.new b/src/etc/sbopkg/sbopkg.conf.new index ad450a3..39d98b7 100644 --- a/src/etc/sbopkg/sbopkg.conf.new +++ b/src/etc/sbopkg/sbopkg.conf.new @@ -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} + diff --git a/src/usr/bin/sbopkg b/src/usr/bin/sbopkg index 9c6e631..3b89658 100755 --- a/src/usr/bin/sbopkg +++ b/src/usr/bin/sbopkg @@ -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 -