aboutsummaryrefslogtreecommitdiff
path: root/trunk/lib/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/lib/common.sh')
-rw-r--r--trunk/lib/common.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index f05b276..ea4130d 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -60,7 +60,7 @@ function pkg_ext_sed {
# list all possible package extensions
# sed regexp version
- echo "($(pkg_ext $1))" | sed -e 's/ /\\|/g'
+ echo "\($(pkg_ext $1)\)" | sed -e 's/ /\\|/g'
}
@@ -69,7 +69,7 @@ function pkg_ext_find {
# list all possible package extensions
# find expr version
- local match
+ local match exts
if [ ! -z "$1" ]; then
match="$1"
@@ -77,7 +77,8 @@ function pkg_ext_find {
match="*"
fi
- echo "($(pkg_ext $match))" | sed -e 's/ / -or -name /g'
+ exts="`echo "$(pkg_ext $match)" | sed -e 's/ / -or -name /g'`"
+ echo "( -name $exts )"
}
@@ -1381,18 +1382,18 @@ function gen_meta {
file="$1"
fi
- if [ "`echo $file | grep -E "(.*{1,})\-(.*[\.\-].*[\.\-].*).$(pkg_ext_grep)[ ]{0,}$"`" == "" ]; then
+ if [ "`echo $file | grep -E \"(.*{1,})\-(.*[\.\-].*[\.\-].*).$(pkg_ext_grep)[ ]{0,}$\"`" == "" ]; then
return
fi
- NAME=$(echo $file | sed -re "s/(.*\/)(.*.$(pkg_ext_sed))$/\2/")
- LOCATION=$(echo $file | sed -re "s/(.*)\/(.*.$(pkg_ext_sed))$/\1/")
+ NAME=$(basename $file)
+ LOCATION=$(dirname $file)
SIZE=$( expr `gunzip -l $file | tail -n 1 | awk '{ print $1 }'` / 1024 )
USIZE=$( expr `gunzip -l $file | tail -n 1 | awk '{ print $2 }'` / 1024 )
REQUIRED=$(tar xzfO $file install/slack-required 2>/dev/null | grep -v -e "^#" | xargs -r -iZ echo -n "Z," | sed -e "s/,$//")
CONFLICTS=$(tar xzfO $file install/slack-conflicts 2>/dev/null | grep -v -e "^#" | xargs -r -iZ echo -n "Z," | sed -e "s/,$//")
SUGGESTS=$(tar xzfO $file install/slack-suggests 2>/dev/null | grep -v -e "^#" | xargs -r )
- METAFILE="$(strip_pkg_exp $NAME).meta"
+ METAFILE="$(strip_pkg_ext $NAME).meta"
echo "PACKAGE NAME: $NAME" > $LOCATION/$METAFILE
@@ -1413,7 +1414,7 @@ function gen_meta {
echo "" >> $LOCATION/$METAFILE
echo "Created metafile for `basename $file`"
- ( cd `dirname $file` && svn_add `strip_pkg_exp $file`.meta )
+ ( cd `dirname $file` && svn_add `strip_pkg_ext $file`.meta )
}