From 5a89b069c876e2f17595ef58cb3d37b059da5e4d Mon Sep 17 00:00:00 2001
From: Jo-Philipp Wich <jow@openwrt.org>
Date: Sun, 16 Jan 2011 22:16:49 +0000
Subject: tools/ipkg-utils: calculate installed size from embedded data.tar.gz,
 makes opkg space checking more precise

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25021 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 tools/ipkg-utils/Makefile                             |  1 -
 tools/ipkg-utils/patches/180-add_installed_size.patch | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 tools/ipkg-utils/patches/180-add_installed_size.patch

(limited to 'tools')

diff --git a/tools/ipkg-utils/Makefile b/tools/ipkg-utils/Makefile
index 48eb7e3795..778260921e 100644
--- a/tools/ipkg-utils/Makefile
+++ b/tools/ipkg-utils/Makefile
@@ -12,7 +12,6 @@ PKG_VERSION:=1.7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://handhelds.org/packages/ipkg-utils/
 PKG_MD5SUM:=da3e3ef772973d7370a6ac95f0fef9b8
-PKG_CAT:=zcat
 
 include $(INCLUDE_DIR)/host-build.mk
 
diff --git a/tools/ipkg-utils/patches/180-add_installed_size.patch b/tools/ipkg-utils/patches/180-add_installed_size.patch
new file mode 100644
index 0000000000..6ee7de8dbc
--- /dev/null
+++ b/tools/ipkg-utils/patches/180-add_installed_size.patch
@@ -0,0 +1,14 @@
+--- a/ipkg-build
++++ b/ipkg-build
+@@ -250,6 +250,11 @@ mkdir $tmp_dir
+ 
+ echo $CONTROL > $tmp_dir/tarX
+ ( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )
++
++installed_size=`du -b $tmp_dir/data.tar.gz | cut -f1`
++sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \
++	$pkg_dir/$CONTROL/control
++
+ ( cd $pkg_dir/$CONTROL && $TAR $ogargs -czf $tmp_dir/control.tar.gz . )
+ rm $tmp_dir/tarX
+ 
-- 
cgit v1.2.3