From: nico Date: Thu, 11 Dec 2008 20:15:41 +0000 (+0000) Subject: add an "Installed-Size" field to package control files, so that opkg could check... X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=commitdiff_plain;h=9eba705f93d602952155a0276709046d4beefc34;hp=66ae166492061c816dffda38860b07ddfb187a01 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 --- diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index c5d4916c2..b91a27710 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