summaryrefslogtreecommitdiff
path: root/scripts/tarpkg
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-12-28 15:01:16 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2009-12-28 15:01:16 +0100
commit91dd4bc6d8f52d62171e721839505f1a80c5a83a (patch)
tree84e325104b40f8ff81db4488b5a6078e18fdc3a1 /scripts/tarpkg
parent03c7aed5dcad2172bbe1bcd311fabb63fbf6dca0 (diff)
use tar archive as default package backend
it saves more than 200 kb on minimal setup for AG241 target. Normally reflashing or complete updates are recommended. Partial updates via ipkg are not supported right now. (we have a read-only root filesystem without any writable partition for any data outside /etc) If someone likes ipkg, it still can be selected and used.
Diffstat (limited to 'scripts/tarpkg')
-rwxr-xr-xscripts/tarpkg18
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/tarpkg b/scripts/tarpkg
index 818f99ea7..f2e5def9e 100755
--- a/scripts/tarpkg
+++ b/scripts/tarpkg
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# create/install compressed tar balls
+#set -x
if [ "$1" = "build" ];then
if [ ! -d $2 ];then
@@ -9,10 +10,25 @@ if [ "$1" = "build" ];then
pkgname=$(grep "^Package:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
version=$(grep "^Version:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
arch=$(grep "^Architecture:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
+ mkdir -p ${2}/usr/lib/pkg
+ for file in preinst postinst prerm postrm; do
+ [ ! -f $2/CONTROL/$file ] || ( cp $2/CONTROL/$file \
+ ${2}/usr/lib/pkg/${pkgname}.$file && \
+ chmod +x ${2}/usr/lib/pkg/${pkgname}.$file )
+ done
rm -rf $2/CONTROL
(cd $2 && tar -czf $3/${pkgname}_${version}_${arch}.tar.gz .)
elif [ "$1" = "install" ];then
- tar -xzpf $2 -C ${INSTROOT}
+ pkg=$(echo $(basename $2)|sed -e "s#_.*##")
+ if [ -x ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst ]; then
+ IPKG_INSTROOT="$PKG_INSTROOT" ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst
+ rm ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst
+ fi
+ tar -xzpf $2 -C ${PKG_INSTROOT}
+ if [ -x ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst ]; then
+ IPKG_INSTROOT="$PKG_INSTROOT" ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst
+ rm ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst
+ fi
else
echo "unknown command"
exit 1