def verifyAllPackages( compsFile, rpmdir, ignoredGroups ): mycomps = comps.parseComps( comps.parseCompsXmlNode( compsFile ) ) compsset = mycomps.packages.keys() foundset = comps.getAllRpmTagNamesInDir( rpmdir ) ignoredset = mycomps.findAllPkgsInGroups( ignoredGroups ) missedInRpms = comps.findMissedPackages( foundset, compsset, ignoredset ) noError = False noWarning = False if len( missedInRpms ) > 0: for pkg in missedInRpms: log.print_error( "no " + pkg + " rpm found in " + rpmdir ) else: noError = not False print "Nothing missed in comps" missedInComps = comps.findMissedPackages( compsset, foundset ) if len( missedInComps ) > 0: for pkg in missedInComps: log.print_warn( "no " + pkg + " rpm found in compsFile" ) else: noWarning = not False print "Nothing missed in comps" if not noError: sys.exit( 1 )
def queryAllPackages( compsFile, ignoredGroups ): mycomps = comps.parseComps( comps.parseCompsXmlNode( compsFile ) ) ignoredpkgs = mycomps.findAllPkgsInGroups( ignoredGroups ) for pkg in mycomps.packages.keys(): if not pkg in ignoredpkgs: print pkg