[oe-commits] org.oe.oz354x ipkg-utils: Fix a bug in the md5sum field handling and add some extra checks (md5sum, size) to ipkg-make-index when reusing data from the previous package file. (from poky) from .dev

hrw commit openembedded-commits at lists.openembedded.org
Tue Aug 22 15:38:48 UTC 2006


ipkg-utils: Fix a bug in the md5sum field handling and add some extra checks (md5sum, size) to ipkg-make-index when reusing data from the previous package file. (from poky) from .dev

Author: hrw at openembedded.org
Branch: org.openembedded.oz354x
Revision: f09d3ca4cb220a76f03a8ee52cdc5ec6a5a3534e
ViewMTN: http://monotone.openembedded.org/revision.psp?id=f09d3ca4cb220a76f03a8ee52cdc5ec6a5a3534e
Files:
1
packages/ipkg-utils/ipkg-utils
packages/ipkg-utils/ipkg-utils/index_speedup.patch
packages/ipkg-utils/ipkg-utils-native_1.6cvs.bb
packages/ipkg-utils/ipkg-utils_1.6cvs.bb
Diffs:

#
# mt diff -rd2658c578fc57137cc3475ff80c59f022813df57 -rf09d3ca4cb220a76f03a8ee52cdc5ec6a5a3534e
#
# 
# 
# add_dir "packages/ipkg-utils/ipkg-utils"
# 
# add_file "packages/ipkg-utils/ipkg-utils/index_speedup.patch"
#  content [d8d0c62aed749ff5f590508e53864f338387216a]
# 
# patch "packages/ipkg-utils/ipkg-utils-native_1.6cvs.bb"
#  from [b92c4c312aae372e06b07696669dcd346b62689d]
#    to [3fce413738d23d0f6e4db9aa315fc5d92cc4a74f]
# 
# patch "packages/ipkg-utils/ipkg-utils_1.6cvs.bb"
#  from [fa95d7080c05f84b8d5360f093ba28993951444a]
#    to [d4823235e7c8a5b2e52a02237883b2cd17cdd4ca]
# 
============================================================
--- packages/ipkg-utils/ipkg-utils/index_speedup.patch	d8d0c62aed749ff5f590508e53864f338387216a
+++ packages/ipkg-utils/ipkg-utils/index_speedup.patch	d8d0c62aed749ff5f590508e53864f338387216a
@@ -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:
============================================================
--- packages/ipkg-utils/ipkg-utils-native_1.6cvs.bb	b92c4c312aae372e06b07696669dcd346b62689d
+++ packages/ipkg-utils/ipkg-utils-native_1.6cvs.bb	3fce413738d23d0f6e4db9aa315fc5d92cc4a74f
@@ -1,12 +1,12 @@
-SECTION = "base"
-include ipkg-utils_${PV}.bb
+require ipkg-utils_${PV}.bb
 SRC_URI += "file://ipkg-utils-fix.patch;patch=1"
-PR = "r5"
+PR = "r6"
 inherit native
 DEPENDS = ""
 RDEPENDS = ""
 # 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
============================================================
--- packages/ipkg-utils/ipkg-utils_1.6cvs.bb	fa95d7080c05f84b8d5360f093ba28993951444a
+++ packages/ipkg-utils/ipkg-utils_1.6cvs.bb	d4823235e7c8a5b2e52a02237883b2cd17cdd4ca
@@ -1,16 +1,15 @@ DESCRIPTION = "Itsy Package Manager util
 DESCRIPTION = "Itsy Package Manager utilities"
-DEPENDS = ""
 SECTION = "base"
 PRIORITY = "optional"
-MAINTAINER = "Chris Larson <kergoth at handhelds.org>"
 LICENSE = "GPL"
 CONFLICTS = "ipkg-link"
 RDEPENDS = "python"
 PV_append = "${CVSDATE}"
-PR = "r9"
+PR = "r10"
 
-SRC_URI = "${HANDHELDS_CVS};module=ipkg-utils"
-	   
+SRC_URI = "${HANDHELDS_CVS};module=ipkg-utils \
+           file://index_speedup.patch;patch=1"
+
 S = "${WORKDIR}/ipkg-utils"
 
 INSTALL = "ipkg-build ipkg-deb-unbuild ipkg-unbuild ipkg-compare-versions ipkg-upload ipkg-make-index ipkg-link ipkg.py"






More information about the Openembedded-commits mailing list