4 Feb
2023
4 Feb
'23
8:18 a.m.
Simplify pkgmk.in at https://crux.nu/gitweb/?p=tools/pkgutils.git;a=blob;f=pkgmk.in;h=9bf381d7e4e... , it's an optional patch, just for your reference. diff --git a/pkgmk.in b/pkgmk.in index 9bf381d7..9d75a82a 100644 --- a/pkgmk.in +++ b/pkgmk.in @@ -65,8 +65,7 @@ get_filename() { } get_basename() { - local FILE="`echo $1 | sed 's|^.*://.*/||g'`" - echo $FILE + echo "${1##*/}" } check_pkgfile() { @@ -140,7 +139,7 @@ download_file() { BASENAME=`get_basename $1` for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do - REPO="`echo $REPO | sed 's|/$||'`" + REPO="${REPO%/}" $PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $REPO/$BASENAME error=$? if [ $error == 0 ]; then