Skip to contentSkip to conversation

Import patches from oe-core

PATCH New Martin Jansa 1 participant 6 messages Mar 29, 2012

lore
Share & tools
lore
#0 lore raw

cover Import patches from oe-core

The following changes since commit 002d29bc605d7c2d02e4cf20a43c5277c15f5597:

[opkg-utils] fix install fail problem Thanks for khorben's patch :-) https://docs.openmoko.org/trac/attachment/ticket/2072/patch-opkg-utils_Makefile_install_path.diff (2008-11-03 03:59:59 +0000)

are available in the git repository at:
git://github.com/shr-project/opkg-utils jansa/pull
https://github.com/shr-project/opkg-utils/tree/jansa/pull

Christopher Larson (1):
Use python via the PATH, rather than hardcoding /usr/bin/python

Enrico Scholz (1):
opkg-make-index: convert mtime to int before comparing it

Khem Raj (1):
opkg.py: Add knowledge about License field in ipk headers

Richard Purdie (1):
opkg-make-index: don't error out when some package disappears

Scott Anderson (1):
arfile.py: handle six digit UIDs

 arfile.py         |    7 ++++++-
 opkg-list-fields  |    2 +-
 opkg-make-index   |   29 ++++++++++++++++++++++++++---
 opkg-show-deps    |    2 +-
 opkg-unbuild      |    2 +-
 opkg-update-index |    2 +-
 opkg.py           |    8 ++++++++
 7 files changed, 44 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.8.5
#1 lore raw

PATCH 1/5 opkg-make-index: don't error out when some package disappears

From: Richard Purdie <[email protected]>

* If we're building an image and some package rebuilds while this is happening some package can be removed/added to the ipk deploy directory. The image will not depend on this package so we can safely ignore these cases rather than error out.

---
 opkg-make-index |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)
opkg-make-index +24 -1
index ae829e6..2f1ae17 100755
@@ -96,6 +96,7 @@ if (verbose):
 files=glob(pkg_dir + '/*.opk') + glob(pkg_dir + '/*.deb') + glob(pkg_dir + '/*.ipk')
 files.sort()
 for filename in files:
+  try:
      basename = os.path.basename(filename)
      pkg = None
      fnameStat = os.stat(filename)
@@ -130,6 +131,12 @@ for filename in files:
                to_morgue(basename)
           if opt_s:
                print filename
+  except OSError:
+      sys.stderr.write("Package %s disappeared on us!\n" % (filename))
+      continue
+  except IOError:
+      sys.stderr.write("Package %s disappeared on us!\n" % (filename))
+      continue
 
 pkgsStampsFile = open(stamplist_filename, "w")
 for f in pkgsStamps.keys():
@@ -148,6 +155,7 @@ if packages_filename:
 names = packages.packages.keys()
 names.sort()
 for name in names:
+  try:
      pkg = packages.packages[name]
      if locales_dir and pkg.depends:
          depends = string.split(pkg.depends, ',')
@@ -165,6 +173,13 @@ for name in names:
      if (verbose):
           sys.stderr.write("Writing info for package %s\n" % (pkg.package,))
      print pkg
+  except OSError:
+      sys.stderr.write("Package %s disappeared on us!\n" % (name))
+      continue
+  except IOError:
+      sys.stderr.write("Package %s disappeared on us!\n" % (name))
+      continue
+
 if packages_filename:
      sys.stdout.close()
      sys.stdout = old_stdout
@@ -182,7 +197,15 @@ files = {}
 names = packages.packages.keys()
 names.sort()
 for name in names:
-     for fn in packages[name].get_file_list():
+     try:
+          fnlist = packages[name].get_file_list()
+     except OSError, e:
+          sys.stderr.write("Package %s disappeared on us!\n" % (name))
+          continue
+     except IOError, e:
+          sys.stderr.write("Package %s disappeared on us!\n" % (name))
+          continue
+     for fn in fnlist:
           (h,t) = os.path.split(fn)
           if not t: continue
           if not files.has_key(t): files[t] = name+':'+fn
Signature · 1 line
1.7.8.5
#2 lore raw

PATCH 2/5 opkg-make-index: convert mtime to int before comparing it

From: Enrico Scholz <[email protected]>

* The st_mtime attribute (which is a float) is compared against a value from the timestamp database, which was stored as an integer there.

* When working on a filesystem with precise timestamps the comparision will fail nearly everytime hence.

* Although it might be possible to enhance the database to store the fractional part too, this will complicate things more than we would gain by this change.

---
 opkg-make-index |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
opkg-make-index +1 -1
index 2f1ae17..dc98c63 100755
@@ -101,7 +101,7 @@ for filename in files:
      pkg = None
      fnameStat = os.stat(filename)
      if old_pkg_hash.has_key(basename):
-          if pkgsStamps.has_key(basename) and fnameStat.st_mtime == pkgsStamps[basename]:
+          if pkgsStamps.has_key(basename) and int(fnameStat.st_mtime) == pkgsStamps[basename]:
             if (verbose):
                sys.stderr.write("Found %s in Packages\n" % (filename,))
             pkg = old_pkg_hash[basename]
Signature · 1 line
1.7.8.5
#3 lore raw

PATCH 3/5 opkg.py: Add knowledge about License field in ipk headers

In reply to Martin Jansa

From: Khem Raj <[email protected]>

---
 opkg.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
opkg.py +8 -0
index 3fda9b5..8ddc8b8 100644
@@ -145,6 +145,7 @@ class Package:
         self.priority = None
         self.tags = None
         self.fn = fn
+        self.license = None
 
         if fn:
             # see if it is deb format
@@ -319,6 +320,12 @@ class Package:
     def get_section(self, section):
         return self.section
 
+    def set_license(self, license):
+        self.license = license
+
+    def get_license(self, license):
+        return self.license
+
     def get_file_list(self):
         if not self.fn:
             return []
@@ -425,6 +432,7 @@ class Package:
         if self.description: out = out + "Description: %s\n" % (self.description)
         if self.oe: out = out + "OE: %s\n" % (self.oe)
         if self.homepage: out = out + "HomePage: %s\n" % (self.homepage)
+        if self.license: out = out + "License: %s\n" % (self.license)
         if self.priority: out = out + "Priority: %s\n" % (self.priority)
         if self.tags: out = out + "Tags: %s\n" % (self.tags)
         out = out + "\n"
Signature · 1 line
1.7.8.5
#4 lore raw

PATCH 4/5 arfile.py: handle six digit UIDs

In reply to Martin Jansa

From: Scott Anderson <[email protected]>

* Essentially, the problem is that arfile.py is splitting the ar header with white-space instead of fixed-width fields, so two fields would get treated as a single field. This makes things better than before as it now honors the fixed field widths.

---
 arfile.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
arfile.py +6 -1
index 22548af..8291a2d 100644
@@ -75,7 +75,12 @@ class ArFile:
                 l = self.f.readline()
                 if not l: break
             l = l.replace('`', '')
-            descriptor = l.split()
+            # Field lengths from /usr/include/ar.h:
+            ar_field_lens = [ 16, 12, 6, 6, 8, 10, 2 ]
+            descriptor = []
+            for field_len in ar_field_lens:
+                descriptor.append(l[:field_len].strip())
+                l = l[field_len:]
 #            print descriptor
             size = int(descriptor[5])
             memberName = descriptor[0][:-1]
Signature · 1 line
1.7.8.5
#5 lore raw

PATCH 5/5 Use python via the PATH, rather than hardcoding /usr/bin/python

In reply to Martin Jansa

From: Christopher Larson <[email protected]>

---
 opkg-list-fields  |    2 +-
 opkg-make-index   |    2 +-
 opkg-show-deps    |    2 +-
 opkg-unbuild      |    2 +-
 opkg-update-index |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
opkg-list-fields +1 -1
index d263b90..da78d53 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 import sys, opkg
 
opkg-make-index +1 -1
index dc98c63..b65dc6e 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 import sys, os, posixpath
 from glob import glob
opkg-show-deps +1 -1
index a6681f4..9de1aac 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 import sys, os, posixpath
 from glob import glob
opkg-unbuild +1 -1
index eff604b..b5c5227 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 import sys, os, re
 
opkg-update-index +1 -1
index 807f8f4..3864fa5 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.1
+#!/usr/bin/env python
 
 import sys, os
 from glob import glob
Signature · 1 line
1.7.8.5