From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SBO69-0001mF-54 for ptxdist@pengutronix.de; Sat, 24 Mar 2012 11:21:25 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1SBO69-0006kc-3g for ptxdist@pengutronix.de; Sat, 24 Mar 2012 11:21:25 +0100 Date: Sat, 24 Mar 2012 11:21:25 +0100 From: Michael Olbrich Message-ID: <20120324102125.GF24724@pengutronix.de> References: <1332537956-28641-1-git-send-email-george.mccollister@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1332537956-28641-1-git-send-email-george.mccollister@gmail.com> Subject: Re: [ptxdist] [PATCH] opkg-utils: Added patch to fill out Installed-Size Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Fri, Mar 23, 2012 at 04:25:56PM -0500, George McCollister wrote: > Installed-Size wasn't being filled out in the Packages file. If > Installed-Size is omitted no disk free space check are performed. > opkg will perform proper disk free space checks when installing > packages from repositories generated using opkg-utils with this patch. Thanks. Applied. Michael > Signed-off-by: George McCollister > --- > ...tils-use-env-python-instead-of-fixed-path.patch | 10 +++--- > .../0006-Fill-out-Installed-Size.patch | 36 ++++++++++++++++++++ > patches/opkg-utils-r4747/series | 3 +- > 3 files changed, 43 insertions(+), 6 deletions(-) > create mode 100644 patches/opkg-utils-r4747/0006-Fill-out-Installed-Size.patch > > diff --git a/patches/opkg-utils-r4747/0001-opkg-utils-use-env-python-instead-of-fixed-path.patch b/patches/opkg-utils-r4747/0001-opkg-utils-use-env-python-instead-of-fixed-path.patch > index e6e00be..fb55bcd 100644 > --- a/patches/opkg-utils-r4747/0001-opkg-utils-use-env-python-instead-of-fixed-path.patch > +++ b/patches/opkg-utils-r4747/0001-opkg-utils-use-env-python-instead-of-fixed-path.patch > @@ -16,7 +16,7 @@ Signed-off-by: George McCollister > 5 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/opkg-list-fields b/opkg-list-fields > -index d263b90..da78d53 100755 > +index d263b90..96057f0 100755 > --- a/opkg-list-fields > +++ b/opkg-list-fields > @@ -1,4 +1,4 @@ > @@ -26,7 +26,7 @@ index d263b90..da78d53 100755 > import sys, opkg > > diff --git a/opkg-make-index b/opkg-make-index > -index ae829e6..6ebba5f 100755 > +index ae829e6..e691f3c 100755 > --- a/opkg-make-index > +++ b/opkg-make-index > @@ -1,4 +1,4 @@ > @@ -36,7 +36,7 @@ index ae829e6..6ebba5f 100755 > import sys, os, posixpath > from glob import glob > diff --git a/opkg-show-deps b/opkg-show-deps > -index a6681f4..9de1aac 100755 > +index a6681f4..af6e7e5 100755 > --- a/opkg-show-deps > +++ b/opkg-show-deps > @@ -1,4 +1,4 @@ > @@ -46,7 +46,7 @@ index a6681f4..9de1aac 100755 > import sys, os, posixpath > from glob import glob > diff --git a/opkg-unbuild b/opkg-unbuild > -index eff604b..b5c5227 100755 > +index eff604b..d39791c 100755 > --- a/opkg-unbuild > +++ b/opkg-unbuild > @@ -1,4 +1,4 @@ > @@ -56,7 +56,7 @@ index eff604b..b5c5227 100755 > import sys, os, re > > diff --git a/opkg-update-index b/opkg-update-index > -index 807f8f4..3864fa5 100755 > +index 807f8f4..3f3a98f 100755 > --- a/opkg-update-index > +++ b/opkg-update-index > @@ -1,4 +1,4 @@ > diff --git a/patches/opkg-utils-r4747/0006-Fill-out-Installed-Size.patch b/patches/opkg-utils-r4747/0006-Fill-out-Installed-Size.patch > new file mode 100644 > index 0000000..fbdde2f > --- /dev/null > +++ b/patches/opkg-utils-r4747/0006-Fill-out-Installed-Size.patch > @@ -0,0 +1,36 @@ > +From: George McCollister > +Date: Fri, 23 Mar 2012 13:13:41 -0500 > +Subject: [PATCH] Fill out Installed-Size > + > +Fill out Installed-Size so opkg can check to make sure there is enough > +space to install the package before attempting to do so. > + > +Signed-off-by: George McCollister > +--- > + opkg.py | 6 +++++- > + 1 files changed, 5 insertions(+), 1 deletions(-) > + > +diff --git a/opkg.py b/opkg.py > +index b000082..2531871 100644 > +--- a/opkg.py > ++++ b/opkg.py > +@@ -162,6 +162,10 @@ class Package: > + ## sys.stderr.write(" extracting control.tar.gz from %s\n"% (fn,)) > + > + ar = arfile.ArFile(f) > ++ tarStream = ar.open("data.tar.gz") > ++ tarf = tarfile.open("data.tar.gz", "r", tarStream) > ++ self.installed_size = sum([f.size for f in tarf.getmembers()]) > ++ > + tarStream = ar.open("control.tar.gz") > + tarf = tarfile.open("control.tar.gz", "r", tarStream) > + > +@@ -437,7 +441,7 @@ class Package: > + if self.md5: out = out + "MD5Sum: %s\n" % (self.md5) > + if self.sha256: out = out + "SHA256Sum: %s\n" % (self.sha256) > + if self.size: out = out + "Size: %d\n" % int(self.size) > +- if self.installed_size: out = out + "InstalledSize: %d\n" % int(self.installed_size) > ++ if self.installed_size: out = out + "Installed-Size: %d\n" % int(self.installed_size) > + if self.filename: out = out + "Filename: %s\n" % (self.filename) > + if self.source: out = out + "Source: %s\n" % (self.source) > + if self.description: out = out + "Description: %s\n" % (self.description) > diff --git a/patches/opkg-utils-r4747/series b/patches/opkg-utils-r4747/series > index af02bbc..3258139 100644 > --- a/patches/opkg-utils-r4747/series > +++ b/patches/opkg-utils-r4747/series > @@ -5,4 +5,5 @@ > 0003-opkg-build-don-t-use-bashism.patch > 0004-opkg-Added-sha256-support.patch > 0005-opkg-build-use-CROSS_COMPILE-ar.patch > -# 3a9d9f3edf82a47598bc29fe4458b0fd - git-ptx-patches magic > +0006-Fill-out-Installed-Size.patch > +# 5aded1e9c50a39f9e0f80584cc2f2aaf - git-ptx-patches magic > -- > 1.7.8.4 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de