mirror of
https://github.com/rworkman/slackpkg
synced 2024-11-15 19:47:54 +01:00
files/slackpkg: SOURCE handling - land softer if no trailing /
This commit is contained in:
parent
b6cf5ec58c
commit
9cea505db9
1 changed files with 15 additions and 2 deletions
|
@ -47,13 +47,26 @@ fi
|
|||
|
||||
#
|
||||
# CONF = configuration directory
|
||||
# SOURCE = A mirror of Slackware. Source can be sett by editing $CONF/mirrors
|
||||
# SOURCE = A mirror of Slackware. Source can be set by editing $CONF/mirrors
|
||||
#
|
||||
VERSION=@VERSION@
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
SLACKWARE_VERSION=$(cat /etc/slackware-version | cut -f2 -d\ )
|
||||
CONF=${CONF:-/etc/slackpkg}
|
||||
SOURCE=$(sed -e 's/^[[:blank:]]*//' $CONF/mirrors | grep -m1 -e "^\([a-z]\)")
|
||||
SOURCE=$(sed -n '
|
||||
# Remove leading and trailing blanks
|
||||
s/^[[:blank:]]*//
|
||||
s/[[:blank:]]*$//
|
||||
# Only one token is allowed per line
|
||||
/[[:blank:]]/d
|
||||
# A single solidus should end the URI
|
||||
s,[/]*$,/,
|
||||
# Print the lines beginning with one of the URI schemes we look for
|
||||
\@^file://@p
|
||||
\@^cdrom://@p
|
||||
\@^local://@p
|
||||
\@^https\{0,1\}://@p
|
||||
\@^ftps\{0,1\}://@p' $CONF/mirrors)
|
||||
. $CONF/slackpkg.conf
|
||||
ERROR=""
|
||||
|
||||
|
|
Loading…
Reference in a new issue