def validate_packages(self): if self._debug: print "DEBUG: Validating all packages in the build directory." pkg_db = {} build_pkg_db(self._builddir, None, pkg_db) nerrors = 0 for pkg_key,pkg_info in pkg_db.items(): pkg_file = pkg_info['script_name'] pkg_name = pkg_info['package'] pkg_props = pkg_info.get('properties','') if self._debug: print "DEBUG: key=%r, name=%r\nDEBUG: file=%r" % ( pkg_key, pkg_name,pkg_file ) if pkg_props: print "DEBUG: properties_pyc=%r" % pkg_props if pkg_key != pkg_name: print "ERROR: Package DB key (%s)" % pkg_key, print "does not match it's internal", print "name package name (%s)" % pkg_name nerrors += 1 pkg_basename = pkg_file.split('/')[-1] if pkg_name != pkg_basename[:-len('.install.pyc')]: print "ERROR: Package name (%s)" % pkg_name, print "is not consistant with it's", print "filename (%s)" % pkg_basename nerrors += 1 if nerrors: raise SystemExit("ERROR: Package validation failed.") return
def validate_packages(self): if self._debug: print "DEBUG: Validating all packages in the build directory." pkg_db = {} build_pkg_db(self._builddir, None, pkg_db) nerrors = 0 for pkg_key, pkg_info in pkg_db.items(): pkg_file = pkg_info['script_name'] pkg_name = pkg_info['package'] pkg_props = pkg_info.get('properties', '') if self._debug: print "DEBUG: key=%r, name=%r\nDEBUG: file=%r" % ( pkg_key, pkg_name, pkg_file) if pkg_props: print "DEBUG: properties_pyc=%r" % pkg_props if pkg_key != pkg_name: print "ERROR: Package DB key (%s)" % pkg_key, print "does not match it's internal", print "name package name (%s)" % pkg_name nerrors += 1 pkg_basename = pkg_file.split('/')[-1] if pkg_name != pkg_basename[:-len('.install.pyc')]: print "ERROR: Package name (%s)" % pkg_name, print "is not consistant with it's", print "filename (%s)" % pkg_basename nerrors += 1 if nerrors: raise SystemExit("ERROR: Package validation failed.") return
def _build_pkg_db(self): # Get a list of all package install scripts in the directory tree. package_db = {} build_pkg_db(self._cwd, None, package_db) return package_db