summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2020-02-07 11:16:48 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2020-02-07 11:16:48 (GMT)
commitbed14b11e3d3070b92bb66203ae42d9e31393299 (patch) (unidiff)
tree81207427dca441f10e72fb42581611ae00336fe4
parent507ae64c3e886b82435cbc963594ed5e2af3458f (diff)
downloadslackupgrade-bed14b11e3d3070b92bb66203ae42d9e31393299.tar.gz
slackupgrade-bed14b11e3d3070b92bb66203ae42d9e31393299.tar.bz2
Make mirror URL configurable via the environment.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--slackupgrade6
-rw-r--r--slackupgrade.84
2 files changed, 7 insertions, 3 deletions
diff --git a/slackupgrade b/slackupgrade
index ff4d46f..ada387b 100644
--- a/slackupgrade
+++ b/slackupgrade
@@ -21,6 +21,7 @@ set -e
21# Configuration directory 21# Configuration directory
22: ${SLACKUPGRADE_CONFDIR:=/etc/slackupgrade} 22: ${SLACKUPGRADE_CONFDIR:=/etc/slackupgrade}
23: ${SLACKUPGRADE_PKGDIR:=/var/slackupgrade} 23: ${SLACKUPGRADE_PKGDIR:=/var/slackupgrade}
24: ${SLACKUPGRADE_MIRRORS_URL:=https://mirrors.slackware.com/slackware}
24# Slackware root directory 25# Slackware root directory
25rooturl= 26rooturl=
26# Log file name 27# Log file name
@@ -461,10 +462,9 @@ fi
461tempdir_create 462tempdir_create
462cd $tempdir 463cd $tempdir
463 464
464mirrors_url=https://mirrors.slackware.com/slackware
465if [ -z "$rooturl" ]; then 465if [ -z "$rooturl" ]; then
466 dnfunc_init 466 dnfunc_init
467 if ! $dnfunc index.html $mirrors_url; then 467 if ! $dnfunc index.html $SLACKUPGRADE_MIRRORS_URL; then
468 abend "exiting" 468 abend "exiting"
469 exit 1 469 exit 1
470 fi 470 fi
@@ -475,7 +475,7 @@ if [ -z "$rooturl" ]; then
475 -e 's/.*^a href="slackware'$ARCH'-([[:digit:].]+)\/?".*/\1/p'|\ 475 -e 's/.*^a href="slackware'$ARCH'-([[:digit:].]+)\/?".*/\1/p'|\
476 sed -n -e "/$version_rx/{" -en -ep -e '}' ) 476 sed -n -e "/$version_rx/{" -en -ep -e '}' )
477 if [ -n "$new_version" ]; then 477 if [ -n "$new_version" ]; then
478 rooturl="$mirrors_url/slackware$ARCH-$new_version" 478 rooturl="$SLACKUPGRADE_MIRRORS_URL/slackware$ARCH-$new_version"
479 info "using $rooturl as distribution top-level URL" 479 info "using $rooturl as distribution top-level URL"
480 else 480 else
481 abend "can't find distribution newer than $VERSION; please supply URL if you have any" 481 abend "can't find distribution newer than $VERSION; please supply URL if you have any"
diff --git a/slackupgrade.8 b/slackupgrade.8
index d58b0e7..ef15eb9 100644
--- a/slackupgrade.8
+++ b/slackupgrade.8
@@ -319,6 +319,10 @@ Location of the \fBslackupgrade\fR package spool directory. This is
319the temporary storage for downloaded package tarballs. The default is 319the temporary storage for downloaded package tarballs. The default is
320.BR /var/slackupgrade . 320.BR /var/slackupgrade .
321.TP 321.TP
322.B SLACKUPGRADE_MIRRORS_URL
323URL of the Slackware mirros site. The default is
324.BR https://mirrors.slackware.com/slackware .
325.TP
322.B TMP 326.B TMP
323Location of the temporary directory. The default is 327Location of the temporary directory. The default is
324.BR /tmp . 328.BR /tmp .

Return to:

Send suggestions and report system problems to the System administrator.