diff --git a/src/etc/sbopkg/sbopkg.conf b/src/etc/sbopkg/sbopkg.conf index 9e27b3b..ebe09dc 100644 --- a/src/etc/sbopkg/sbopkg.conf +++ b/src/etc/sbopkg/sbopkg.conf @@ -48,3 +48,9 @@ DIFF=${DIFF:-diff} DIFFOPTS=${DIFFOPTS:--u} RSYNCFLAGS="${RSYNCFLAGS:---verbose --timeout=30}" WGETFLAGS="${WGETFLAGS:--c --progress=bar:force --timeout=30 --tries=5}" + +# SRC_REPO defaults to "http://slackware.uk/sbosrcarch". To use +# a different repository, uncomment and edit this variable. The value +# must be the URL of the directory containing the by-name and by-md5 +# sub directories, and should NOT have a trailing slash. +# SRC_REPO="http://slackware.uk/sbosrcarch" diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index a87845f..20d2dca 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -2891,7 +2891,8 @@ check_source() { # - $3 = source file name # Returns 0 if the source is OK, 1 if the source should be (re)downloaded # (this includes the cases where $3 is empty or refers to a nonexistent - # file) and 2 if the user asked to abort the build. + # file) and 2 if the user asked to abort the build or 3 if the user + # asked to look in the alternate repository local PKG=$1 local MD5SUM="$2" @@ -2931,11 +2932,11 @@ $SRCNAME in $SRCDIR? You can choose among the following options: - (Y)es, keep the source and continue the build process; - - (N)o, delete the source and abort the build process; or - - (R)etry download and continue the build process. - + - (N)o, delete the source and abort the build process; + - (R)etry download and continue the build process; or + - (A)ttempt to download from third party source repository. EOF - printf "(Y)es, (N)o, (R)etry?: " + printf "(Y)es, (N)o, (R)etry, (A)lternative ?: " error_read case $REPLY in Y|y) @@ -2953,6 +2954,10 @@ EOF echo " Downloading again." | tee -a $TMPSUMMARYLOG return 1 ;; + A|a) + echo " Searching source repository." | tee -a $TMPSUMMARYLOG + return 3 + ;; *) unknown_response ;; @@ -2988,6 +2993,15 @@ check_cert_prompt() { done } +make_archive_url() { + # Get (and echo) the sbosrcarch URL for a source + local MD5SUM=$1 + local SRCNAME=$2 + + local ARCHIVE=${SRC_REPO:-"http://slackware.uk/sbosrcarch"} + echo $ARCHIVE/by-md5/${MD5SUM:0:1}/${MD5SUM:1:1}/$MD5SUM/$SRCNAME +} + get_source() { # Check to see if the source tarball exists in the local cache directory. # If it does, make a symlink to the package directory in the local mirror. @@ -3045,6 +3059,9 @@ get_source() { FAILURE=download break 2 ;; + 3 ) # Archive + DOWNLOAD[$i]=$( make_archive_url ${MD5SUM[$i]} ${SRCNAME[$i]} ) + ;; esac rm -rf $DLDIR diff --git a/tools/ChangeLog-latest.txt b/tools/ChangeLog-latest.txt index 30956c2..5b913ab 100644 --- a/tools/ChangeLog-latest.txt +++ b/tools/ChangeLog-latest.txt @@ -1,6 +1,13 @@ SBOPKG NEWS -sbopkg-dev (2016-08-30 23:14:21 UTC) +sbopkg-dev (2016-08-30 22:19:30 UTC) + FEATURES + * Added option to download from third party source repository + in case the one mentioned in .info failed or having bad checksums. + * Added new option in sbopkg.conf: SRC_REPO + This is used to define third party source repository + sbopkg: Added option to download from third party source. + MODIFICATIONS * Do not use wildcard for GPG checking (Fix #19)