diff options
author | Juan RP <xtraeme@voidlinux.eu> | 2015-09-11 05:55:40 +0000 |
---|---|---|
committer | Juan RP <xtraeme@voidlinux.eu> | 2015-09-11 05:55:40 +0000 |
commit | bcdacb66a0329a81704d559705aab21ab840866e (patch) | |
tree | 1b164630570e135f65f65dcdf1c7919bb93a42e7 /common/hooks/post-install | |
parent | ea9c012c049f11e6c118383a589424304d454a97 (diff) | |
download | void-packages-bcdacb66a0329a81704d559705aab21ab840866e.tar void-packages-bcdacb66a0329a81704d559705aab21ab840866e.tar.gz void-packages-bcdacb66a0329a81704d559705aab21ab840866e.tar.bz2 void-packages-bcdacb66a0329a81704d559705aab21ab840866e.tar.lz void-packages-bcdacb66a0329a81704d559705aab21ab840866e.tar.xz void-packages-bcdacb66a0329a81704d559705aab21ab840866e.tar.zst void-packages-bcdacb66a0329a81704d559705aab21ab840866e.zip |
xbps-src: replace basename(1) with ${var##*/}.
Reduce number of fork+exec due to using a subshell to execute basename(1).
Diffstat (limited to 'common/hooks/post-install')
-rw-r--r-- | common/hooks/post-install/00-compress-info-files.sh | 2 | ||||
-rw-r--r-- | common/hooks/post-install/04-create-xbps-metadata-scripts.sh | 2 | ||||
-rw-r--r-- | common/hooks/post-install/06-strip-and-debug-pkgs.sh | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/common/hooks/post-install/00-compress-info-files.sh b/common/hooks/post-install/00-compress-info-files.sh index f76e6eebb14..6ae8c132880 100644 --- a/common/hooks/post-install/00-compress-info-files.sh +++ b/common/hooks/post-install/00-compress-info-files.sh @@ -32,7 +32,7 @@ hook() { if [ -h ${PKGDESTDIR}/"$j" ]; then dirat=$(dirname "$j") lnkat=$(readlink ${PKGDESTDIR}/"$j") - newlnk=$(basename "$j") + newlnk="${j##*/}" rm -f ${PKGDESTDIR}/"$j" cd ${PKGDESTDIR}/"$dirat" ln -s "${lnkat}".gz "${newlnk}".gz diff --git a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh index 90704ff16f5..36dbc8c72fa 100644 --- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh +++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh @@ -205,7 +205,7 @@ _EOF if [ -d ${PKGDESTDIR}/usr/share/gconf/schemas ]; then _add_trigger gconf-schemas for f in ${PKGDESTDIR}/usr/share/gconf/schemas/*.schemas; do - _schemas="${_schemas} $(basename $f)" + _schemas="${_schemas} ${f##*/}" done echo "export gconf_schemas=\"${_schemas}\"" >> $tmpf fi diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh index 9bc66c7aa7d..7e8ddfc80b5 100644 --- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh +++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh @@ -8,7 +8,7 @@ make_debug() { [ -n "$nodebug" ] && return 0 dname=$(echo "$(dirname $1)"|sed -e "s|${PKGDESTDIR}||g") - fname="$(basename $1)" + fname="${1##*/}" dbgfile="${dname}/${fname}" mkdir -p "${PKGDESTDIR}/usr/lib/debug/${dname}" @@ -27,7 +27,7 @@ attach_debug() { [ -n "$nodebug" ] && return 0 dname=$(echo "$(dirname $1)"|sed -e "s|${PKGDESTDIR}||g") - fname="$(basename $1)" + fname="${1##*/}" dbgfile="${dname}/${fname}" $OBJCOPY --add-gnu-debuglink="${PKGDESTDIR}/usr/lib/debug/${dbgfile}" "$1" @@ -69,7 +69,7 @@ hook() { continue fi - fname=$(basename "$f") + fname=${f##*/} for x in ${nostrip_files}; do if [ "$x" = "$fname" ]; then found=1 |