aboutsummaryrefslogtreecommitdiffstats
path: root/FAQ.html
diff options
context:
space:
mode:
authorJason Woodward2009-04-29 04:35:30 +0000
committerJason Woodward2009-04-29 04:35:30 +0000
commit2382eb8afbb9b6d5dd42604fbe9193444d371046 (patch)
treeb595eecf79feb71a7acdd36af75812a10eb067e1 /FAQ.html
parent1575589db6d45de5a28937fa85cdffc26f99c62d (diff)
downloadslapt-get-2382eb8afbb9b6d5dd42604fbe9193444d371046.tar.gz
modernized script in FAQ#17. How do I create my own package source?
Diffstat (limited to 'FAQ.html')
-rw-r--r--FAQ.html34
1 files changed, 21 insertions, 13 deletions
diff --git a/FAQ.html b/FAQ.html
index 988b30e..62801cc 100644
--- a/FAQ.html
+++ b/FAQ.html
@@ -387,17 +387,25 @@
echo "File not found: $1"
exit 1;
fi
- if [ "`echo $1|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).tgz[ ]{0,}$'`" == "" ]; then
+ if [ "`echo $1|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).[tgblzikx]{2,}[ ]{0,}$'`" == "" ]; then
return;
fi
- NAME=$(echo $1|sed -re "s/(.*\/)(.*.tgz)$/\2/")
- LOCATION=$(echo $1|sed -re "s/(.*)\/(.*.tgz)$/\1/")
- SIZE=$( expr `gunzip -l $1 |tail -1|awk '{print $1}'` / 1024 )
- USIZE=$( expr `gunzip -l $1 |tail -1|awk '{print $2}'` / 1024 )
- REQUIRED=$(tar xzfO $1 install/slack-required 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
- CONFLICTS=$(tar xzfO $1 install/slack-conflicts 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
- SUGGESTS=$(tar xzfO $1 install/slack-suggests 2>/dev/null|xargs -r )
- METAFILE=${NAME%tgz}meta
+
+ PKGEXT=${1##*.}
+ case $PKGEXT in
+ tgz) DECOMPRESS=gzip ;;
+ tbz) DECOMPRESS=bzip2 ;;
+ tlz) DECOMPRESS=lzma ;;
+ esac
+
+ NAME=$(echo $1|sed -re "s/(.*\/)(.*.$PKGEXT)$/\2/")
+ LOCATION=$(echo $1|sed -re "s/(.*)\/(.*.$PKGEXT)$/\1/")
+ SIZE=$(du -bk $1)
+ USIZE=$(expr $(cat $1 | $DECOMPRESS -dc | wc -c) / 1024)
+ REQUIRED=$($DECOMPRESS -dc $1 | tar -xO install/slack-required 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
+ CONFLICTS=$($DECOMPRESS -dc $1 | tar -xO install/slack-conflicts 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//")
+ SUGGESTS=$($DECOMPRESS -dc | tar -xO install/slack-suggests 2>/dev/null|xargs -r )
+ METAFILE=${NAME%$PKGEXT}meta
echo "PACKAGE NAME: $NAME" > $LOCATION/$METAFILE
if [ -n "$DL_URL" ]; then
echo "PACKAGE MIRROR: $DL_URL" >> $LOCATION/$METAFILE
@@ -409,7 +417,7 @@
echo "PACKAGE CONFLICTS: $CONFLICTS" >> $LOCATION/$METAFILE
echo "PACKAGE SUGGESTS: $SUGGESTS" >> $LOCATION/$METAFILE
echo "PACKAGE DESCRIPTION:" >> $LOCATION/$METAFILE
- tar xzfO $1 install/slack-desc |grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE
+ $DECOMPRESS -dc | tar -xO install/slack-desc |grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE
echo "" >> $LOCATION/$METAFILE
}
@@ -422,7 +430,7 @@
fi
;;
all)
- for pkg in `find . -type f -name '*.tgz' -print`
+ for pkg in `find . -type f -regex '.*\.[tgblzikx]+$' -print`
do
gen_meta $pkg
done
@@ -430,9 +438,9 @@
$0 MD5
;;
new)
- for pkg in `find . -type f -name '*.tgz' -print`
+ for pkg in `find . -type f -regex '.*\.[tgblzikx]+$' -print`
do
- if [ ! -f ${pkg%tgz}meta ]; then
+ if [ ! -f ${pkg%${pkg##*.}}meta ]; then
gen_meta $pkg
fi
done