mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: George McCollister <george.mccollister@gmail.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] opkg-utils: Added patch to fill out Installed-Size
Date: Fri, 23 Mar 2012 16:25:56 -0500	[thread overview]
Message-ID: <1332537956-28641-1-git-send-email-george.mccollister@gmail.com> (raw)

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.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
---
 ...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 <george.mccollister@gmail.com>
  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 <george.mccollister@gmail.com>
+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 <george.mccollister@gmail.com>
+---
+ 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

             reply	other threads:[~2012-03-23 21:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 21:25 George McCollister [this message]
2012-03-24 10:21 ` Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332537956-28641-1-git-send-email-george.mccollister@gmail.com \
    --to=george.mccollister@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox