author | Sergey 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) |
commit | bed14b11e3d3070b92bb66203ae42d9e31393299 (patch) (unidiff) | |
tree | 81207427dca441f10e72fb42581611ae00336fe4 | |
parent | 507ae64c3e886b82435cbc963594ed5e2af3458f (diff) | |
download | slackupgrade-bed14b11e3d3070b92bb66203ae42d9e31393299.tar.gz slackupgrade-bed14b11e3d3070b92bb66203ae42d9e31393299.tar.bz2 |
Make mirror URL configurable via the environment.
-rw-r--r-- | slackupgrade | 6 | ||||
-rw-r--r-- | slackupgrade.8 | 4 |
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 |
25 | rooturl= | 26 | rooturl= |
26 | # Log file name | 27 | # Log file name |
@@ -461,10 +462,9 @@ fi | |||
461 | tempdir_create | 462 | tempdir_create |
462 | cd $tempdir | 463 | cd $tempdir |
463 | 464 | ||
464 | mirrors_url=https://mirrors.slackware.com/slackware | ||
465 | if [ -z "$rooturl" ]; then | 465 | if [ -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 | |||
319 | the temporary storage for downloaded package tarballs. The default is | 319 | the 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 | ||
323 | URL of the Slackware mirros site. The default is | ||
324 | .BR https://mirrors.slackware.com/slackware . | ||
325 | .TP | ||
322 | .B TMP | 326 | .B TMP |
323 | Location of the temporary directory. The default is | 327 | Location of the temporary directory. The default is |
324 | .BR /tmp . | 328 | .BR /tmp . |