aboutsummaryrefslogtreecommitdiff
path: root/trunk/lib/common.sh
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-08-30 23:38:25 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-08-30 23:38:25 +0000
commit2c25db7f837aca99ac150fa91b2149849f0687b0 (patch)
treef4f0cddba5261d260c20b1ca005e4b276ec8a7ff /trunk/lib/common.sh
parent83dd37ec007c0244b23241be4c6a134f8b993c28 (diff)
downloadsimplepkg-2c25db7f837aca99ac150fa91b2149849f0687b0.tar.gz
simplepkg-2c25db7f837aca99ac150fa91b2149849f0687b0.tar.bz2
Cleanup and bugfix for #94 and #95 (2)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@813 04377dda-e619-0410-9926-eae83683ac58
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 )
}