diff options
author | Holger Freyther <zecke@selfish.org> | 2006-05-13 23:02:05 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-05-13 23:02:05 +0000 |
commit | 3a91da80ac6061e46fe4b407035936995a2e86ff (patch) | |
tree | 0203b471146b3e0543b1aacb7404f9374744c8c5 | |
parent | cab3617a57c2308ef14d43acfe4d3db8fbaf6c74 (diff) | |
parent | 69bdd1a150ad4017fa2518df05cff17be98e9cb5 (diff) |
merge of 1ee22e5dc2cdeec8a88f1136a019329901a0c9f3
and fa3e1e73f0b7c3d2d474cf62d9f0eb34c322dbb5
-rw-r--r-- | contrib/qa/ipkg-diff/ipkg-diff | 32 | ||||
-rw-r--r-- | contrib/qa/ipkg-diff/ipkg.py | 32 |
2 files changed, 44 insertions, 20 deletions
diff --git a/contrib/qa/ipkg-diff/ipkg-diff b/contrib/qa/ipkg-diff/ipkg-diff index 276b8b2e1e..babfa17554 100644 --- a/contrib/qa/ipkg-diff/ipkg-diff +++ b/contrib/qa/ipkg-diff/ipkg-diff @@ -44,31 +44,35 @@ def diff_dirs( old_ipks, new_ipks ): return only_old, both, only_new def diff_packages( old, new ): - def compare( name, version, method, txt ): + def compare( name, version, attribute, txt ): """ Compare package with name and version with method and print error message """ try: - if not method( old[package_name][version], new[package_name][version] ): + left = getattr( old[package_name][version], 'get_' + attribute ) + right = getattr( new[package_name][version], 'get_' + attribute ) + if not left() == right(): print txt - except: + except Exception, e: + raise e print "Error with %s %s and '%s'" % (package_name,version, txt) for package_name in old.keys(): for version in old[package_name].keys(): print "Comparing %s %s" % (package_name, version) - compare( package_name, version, lambda x,y: x.get_maintainer() == y.get_maintainer(), "Maintainer is different" ) - compare( package_name, version, lambda x,y: x.get_architecture() == y.get_architecture(), "Architecture is different" ) - compare( package_name, version, lambda x,y: x.get_description() == y.get_description(), "Description is different" ) - compare( package_name, version, lambda x,y: x.get_depends() == y.get_depends(), "Depends are different" ) - compare( package_name, version, lambda x,y: x.get_provides() == y.get_provides(), "Provides are different" ) - compare( package_name, version, lambda x,y: x.get_conflicts() == y.get_conflicts(), "Provides are different" ) - compare( package_name, version, lambda x,y: x.get_suggests() == y.get_suggests(), "Suggests are different" ) - compare( package_name, version, lambda x,y: x.get_source() == y.get_source(), "Source is different" ) - compare( package_name, version, lambda x,y: x.get_section() == y.get_section(), "Section is different" ) - compare( package_name, version, lambda x,y: x.get_file_list() == y.get_file_list(), "Filelist is different" ) - compare( package_name, version, lambda x,y: x.md5 == y.md5, "MD5 is different" ) + compare( package_name, version, 'maintainer', "Maintainer is different" ) + compare( package_name, version, 'architecture', "Architecture is different" ) + compare( package_name, version, 'description', "Description is different" ) + compare( package_name, version, 'depends', "Depends are different" ) + compare( package_name, version, 'provides', "Provides are different" ) + compare( package_name, version, 'conflicts', "Provides are different" ) + compare( package_name, version, 'suggests', "Suggests are different" ) + compare( package_name, version, 'source', "Source is different" ) + compare( package_name, version, 'section', "Section is different" ) + compare( package_name, version, 'file_list', "Filelist is different" ) + compare( package_name, version, 'file_all_list', "Filelist is different" ) + compare( package_name, version, 'md5', "MD5 is different" ) def print_result_start( old, both, new ): """ diff --git a/contrib/qa/ipkg-diff/ipkg.py b/contrib/qa/ipkg-diff/ipkg.py index 02aab229ee..4ef28bf7cd 100644 --- a/contrib/qa/ipkg-diff/ipkg.py +++ b/contrib/qa/ipkg-diff/ipkg.py @@ -120,6 +120,7 @@ class Package: self.section = None self.filename_header = None self.file_list = [] + self.file_all_list = [] self.md5 = None self.size = None self.installed_size = None @@ -188,6 +189,19 @@ class Package: self.file_list.append(string.rstrip(line)) data.close() + # bigger listing with all permissions + if self.isdeb: + data = os.popen("ar p "+fn+" data.tar.gz | tar tvfz -","r") + else: + data = os.popen("tar xfzO "+fn+" '*data.tar.gz' | tar tvfz -","r") + while 1: + line = data.readline() + if not line: break + self.file_all_list.append(string.rstrip(line)) + data.close() + + + self.scratch_dir = None self.file_dir = None self.meta_dir = None @@ -269,42 +283,48 @@ class Package: def set_depends(self, depends): self.depends = depends - def get_depends(self, depends): + def get_depends(self): return self.depends def set_provides(self, provides): self.provides = provides - def get_provides(self, provides): + def get_provides(self): return self.provides def set_replaces(self, replaces): self.replaces = replaces - def get_replaces(self, replaces): + def get_replaces(self): return self.replaces def set_conflicts(self, conflicts): self.conflicts = conflicts - def get_conflicts(self, conflicts): + def get_conflicts(self): return self.conflicts def set_suggests(self, suggests): self.suggests = suggests - def get_suggests(self, suggests): + def get_suggests(self): return self.suggests def set_section(self, section): self.section = section - def get_section(self, section): + def get_section(self): return self.section def get_file_list(self): return self.file_list + def get_file_all_list(self): + return self.file_all_list + + def get_md5(self): + return self.md5 + def write_package(self, dirname): buf = self.render_control() file = open("%s/control" % self.meta_dir, 'w') |