]> code.ossystems Code Review - openembedded-core.git/commitdiff
ipkg-utils: Fix a bug in the md5sum field handling and add some extra checks (md5sum...
authorRichard Purdie <richard@openedhand.com>
Mon, 24 Jul 2006 08:24:07 +0000 (08:24 +0000)
committerRichard Purdie <richard@openedhand.com>
Mon, 24 Jul 2006 08:24:07 +0000 (08:24 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@544 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/packages/ipkg-utils/ipkg-utils-native_1.6+cvs20050404.bb
meta/packages/ipkg-utils/ipkg-utils/index_speedup.patch [new file with mode: 0644]
meta/packages/ipkg-utils/ipkg-utils_1.6+cvs20050404.bb

index ab8f4d63e0a71357de5522c26d4b9f15078f7705..bfb91f2f561bfe1a1d19666512297a832f6a5672 100644 (file)
@@ -2,12 +2,13 @@ include ipkg-utils_${PV}.bb
 SRC_URI += "file://ipkg-utils-fix.patch;patch=1"
 
 RDEPENDS = ""
-PR = "r7"
+PR = "r8"
 
 inherit native
 
 # Avoid circular dependencies from package_ipk.bbclass
 PACKAGES = ""
+FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/ipkg-utils"
 
 do_stage() {
         for i in ${INSTALL}; do
diff --git a/meta/packages/ipkg-utils/ipkg-utils/index_speedup.patch b/meta/packages/ipkg-utils/ipkg-utils/index_speedup.patch
new file mode 100644 (file)
index 0000000..bef28a9
--- /dev/null
@@ -0,0 +1,53 @@
+Index: ipkg-utils/ipkg-make-index
+===================================================================
+--- ipkg-utils.orig/ipkg-make-index    2005-03-20 18:10:54.000000000 +0000
++++ ipkg-utils/ipkg-make-index 2006-07-24 09:18:16.000000000 +0100
+@@ -37,6 +37,21 @@
+      if os.path.exists(pkg_dir + "/" + filename + ".asc"):
+           os.rename(pkg_dir + "/" + filename + ".asc", locale_dir + "/" + filename + ".asc")
++def md5sum(file):
++     import md5
++     sum = md5.new()
++     f = open(file, "r")
++     while 1:
++          data = f.read(1024)
++          if not data: break
++          sum.update(data)
++     f.close()
++     if sys.version[:1] > '2':
++          # when using Python 2.0 or newer
++          return sum.hexdigest()
++     else:
++          return string.join(map((lambda x:"%02x" % ord(x)),sum.digest()),'')
++
+ old_filename = None
+ packages_filename = None
+ filelist_filename = "Packages.filelist"
+@@ -87,7 +102,7 @@
+ files.sort()
+ for filename in files:
+      basename = os.path.basename(filename)
+-     if old_pkg_hash.has_key(basename):
++     if old_pkg_hash.has_key(basename) and old_pkg_hash[basename].md5 == md5sum(filename) and old_pkg_hash[basename].size == os.stat(filename)[6]:
+           if (verbose):
+                sys.stderr.write("Found %s in Packages\n" % (filename,))
+           pkg = old_pkg_hash[basename]
+Index: ipkg-utils/ipkg.py
+===================================================================
+--- ipkg-utils.orig/ipkg.py    2005-01-20 23:09:10.000000000 +0000
++++ ipkg-utils/ipkg.py 2006-07-24 09:16:44.000000000 +0100
+@@ -210,8 +210,13 @@
+                     value = value + '\n' + line
+                 if name == 'size':
+                     self.size = int(value)
++              elif name == 'md5sum':
++                    self.md5 = value
+                 elif self.__dict__.has_key(name):
+                     self.__dict__[name] = value
++              else:
++                  print "Lost field %s, %s" % (name,value)
++
+                 if line[0] == '\n':
+                     return # consumes one blank line at end of package descriptoin
+             else:
index 12ed042f155064783ce541e2d3c968a5416c5875..48c7445828ead1632ec4d1e2601afd452072f86c 100644 (file)
@@ -5,9 +5,10 @@ LICENSE = "GPL"
 CONFLICTS = "ipkg-link"
 RDEPENDS = "python"
 SRCDATE = "20050404"
-PR = "r11"
+PR = "r12"
 
-SRC_URI = "${HANDHELDS_CVS};module=ipkg-utils"
+SRC_URI = "${HANDHELDS_CVS};module=ipkg-utils \
+           file://index_speedup.patch;patch=1"
 
 S = "${WORKDIR}/ipkg-utils"