def populate(self): """ Scans all package in SIT and stores the ground-truth pkgInfo.py information into one giant hashtable for later fast access. The assignment is "packageURL": { pkgInfo data } """ sitPath = SIT.getPath() canonicalPaths = SIT.getCanonicalPaths(sitPath) Any.requireIsListNonEmpty(canonicalPaths) for canonicalPath in canonicalPaths: ProjectProperties.requireIsCanonicalPath(canonicalPath) packageURL = 'sit://' + canonicalPath installRoot = os.path.join(sitPath, canonicalPath) detector = PackageDetector(installRoot) detector.retrieveMakefileInfo() self._cache[packageURL] = detector
argman.addExample('%(prog)s') args = vars(argman.run()) showAll = args['all'] if not args['verbose']: # disable typical progress logging Any.setDebugLevel(0) #---------------------------------------------------------------------------- # Main program #---------------------------------------------------------------------------- sitPath = SIT.getPath() fullPkgList = SIT.getCanonicalPaths(sitPath) Any.requireIsListNonEmpty(fullPkgList) if showAll: # "-a|--all": check all packages pkgList = fullPkgList else: # default: filter-out packages which typically have no dependees filterFunc = lambda canonicalPath: not canonicalPath.startswith(blacklist) pkgList = filter(filterFunc, fullPkgList) for canonicalPath in pkgList: package = BSTPackage.BSTInstalledPackage('sit://' + canonicalPath) package.retrieveReverseDependencies(recursive=False) if not package.revDepSet: