aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Thill <nico@openwrt.org>2008-12-11 20:15:41 +0000
committerNicolas Thill <nico@openwrt.org>2008-12-11 20:15:41 +0000
commitddda8a051f3ef5c676cbeeb2a54d5ee967c941d9 (patch)
tree42f4f5d0d51b7199a59871a3142474cc6a7ef8b0
parente6132bbde2cf4b3de116e4418e23c737d3e7a2e7 (diff)
downloadmaster-187ad058-ddda8a051f3ef5c676cbeeb2a54d5ee967c941d9.tar.gz
master-187ad058-ddda8a051f3ef5c676cbeeb2a54d5ee967c941d9.tar.bz2
master-187ad058-ddda8a051f3ef5c676cbeeb2a54d5ee967c941d9.zip
add an "Installed-Size" field to package control files, so that opkg could check needed vs. available storage space before installing a package
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13602 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--include/package-ipkg.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index c5d4916c2c..b91a27710b 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -72,6 +72,7 @@ ifeq ($(DUMP),)
echo "Priority: $(PRIORITY)"; \
echo "Maintainer: $(MAINTAINER)"; \
echo "Architecture: $(PKGARCH)"; \
+ echo "Installed-Size: 1"; \
echo -n "Description: "; getvar $(call shvar,Package/$(1)/description) | sed -e 's,^[[:space:]]*, ,g'; \
) >> $$(IDIR_$(1))/CONTROL/control
chmod 644 $$(IDIR_$(1))/CONTROL/control
@@ -84,6 +85,8 @@ ifeq ($(DUMP),)
mkdir -p $(PACKAGE_DIR)
-find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' | $(XARGS) rm -rf
$(RSTRIP) $$(IDIR_$(1))
+ SIZE=`cd $$(IDIR_$(1)); du -bs --exclude=./CONTROL . 2>/dev/null | cut -f1`; \
+ $(SED) "s|^\(Installed-Size:\).*|\1 $$$$SIZE|g" $$(IDIR_$(1))/CONTROL/control
$(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
@[ -f $$(IPKG_$(1)) ] || false