mirror of
https://github.com/sbopkg/sbopkg
synced 2025-01-30 20:34:23 +01:00
sbopkg: Added option to download from third party source.
Thanks to B. Watson for the patch. Fixed #12. Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
parent
7d136353a1
commit
89db46142a
3 changed files with 36 additions and 6 deletions
|
@ -48,3 +48,9 @@ DIFF=${DIFF:-diff}
|
||||||
DIFFOPTS=${DIFFOPTS:--u}
|
DIFFOPTS=${DIFFOPTS:--u}
|
||||||
RSYNCFLAGS="${RSYNCFLAGS:---verbose --timeout=30}"
|
RSYNCFLAGS="${RSYNCFLAGS:---verbose --timeout=30}"
|
||||||
WGETFLAGS="${WGETFLAGS:--c --progress=bar:force --timeout=30 --tries=5}"
|
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"
|
||||||
|
|
|
@ -2891,7 +2891,8 @@ check_source() {
|
||||||
# - $3 = source file name
|
# - $3 = source file name
|
||||||
# Returns 0 if the source is OK, 1 if the source should be (re)downloaded
|
# 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
|
# (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 PKG=$1
|
||||||
local MD5SUM="$2"
|
local MD5SUM="$2"
|
||||||
|
@ -2931,11 +2932,11 @@ $SRCNAME in $SRCDIR?
|
||||||
|
|
||||||
You can choose among the following options:
|
You can choose among the following options:
|
||||||
- (Y)es, keep the source and continue the build process;
|
- (Y)es, keep the source and continue the build process;
|
||||||
- (N)o, delete the source and abort the build process; or
|
- (N)o, delete the source and abort the build process;
|
||||||
- (R)etry download and continue the build process.
|
- (R)etry download and continue the build process; or
|
||||||
|
- (A)ttempt to download from third party source repository.
|
||||||
EOF
|
EOF
|
||||||
printf "(Y)es, (N)o, (R)etry?: "
|
printf "(Y)es, (N)o, (R)etry, (A)lternative ?: "
|
||||||
error_read
|
error_read
|
||||||
case $REPLY in
|
case $REPLY in
|
||||||
Y|y)
|
Y|y)
|
||||||
|
@ -2953,6 +2954,10 @@ EOF
|
||||||
echo " Downloading again." | tee -a $TMPSUMMARYLOG
|
echo " Downloading again." | tee -a $TMPSUMMARYLOG
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
|
A|a)
|
||||||
|
echo " Searching source repository." | tee -a $TMPSUMMARYLOG
|
||||||
|
return 3
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
unknown_response
|
unknown_response
|
||||||
;;
|
;;
|
||||||
|
@ -2988,6 +2993,15 @@ check_cert_prompt() {
|
||||||
done
|
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() {
|
get_source() {
|
||||||
# Check to see if the source tarball exists in the local cache directory.
|
# 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.
|
# If it does, make a symlink to the package directory in the local mirror.
|
||||||
|
@ -3045,6 +3059,9 @@ get_source() {
|
||||||
FAILURE=download
|
FAILURE=download
|
||||||
break 2
|
break 2
|
||||||
;;
|
;;
|
||||||
|
3 ) # Archive
|
||||||
|
DOWNLOAD[$i]=$( make_archive_url ${MD5SUM[$i]} ${SRCNAME[$i]} )
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
rm -rf $DLDIR
|
rm -rf $DLDIR
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
SBOPKG NEWS
|
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
|
MODIFICATIONS
|
||||||
* Do not use wildcard for GPG checking (Fix #19)
|
* Do not use wildcard for GPG checking (Fix #19)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue