libapse.lib: do not use "dirname" and "basename": bash provides primitives to do that

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-07-07 21:20:22 +02:00
parent 037669307b
commit 89d6517a79
2 changed files with 6 additions and 2 deletions

View File

@ -53,6 +53,10 @@ Changes in version 1.12.3
* lib/libapse.lib, lib/libspec.lib - Davide Madrisan: * lib/libapse.lib, lib/libspec.lib - Davide Madrisan:
Style fixes. Style fixes.
+ improvement
* lib/libapse.lib - Davide Madrisan:
Do not use 'dirname' and 'basename': bash provides primitives to do that.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Changes in version 1.12.2 Changes in version 1.12.2

View File

@ -311,10 +311,10 @@ ${proxy:+ --proxy $proxy}${proxy_user:+ --proxy-user $proxy_user}"
notify.debug "$FUNCNAME: skipping ${apse_site_name[0]}" notify.debug "$FUNCNAME: skipping ${apse_site_name[0]}"
else else
if [[ "$pckurl" =~ .*://.* ]]; then if [[ "$pckurl" =~ .*://.* ]]; then
local pckurldir="`dirname $pckurl`/" local pckurldir="${pckurl%/*}/"
notify.debug "$FUNCNAME: pckurldir = $pckurldir" notify.debug "$FUNCNAME: pckurldir = $pckurldir"
local pcknameverbatim=`basename $pckurlverbatim` local pcknameverbatim="${pckurlverbatim##*/}"
notify.debug "$FUNCNAME: pcknameverbatim = $pcknameverbatim" notify.debug "$FUNCNAME: pcknameverbatim = $pcknameverbatim"
curr_curl_url="$pckurldir" curr_curl_url="$pckurldir"