Beispiel #1
0
    def retrieveMaintainer(self):
        try:
            data = self.pkgInfoContent['maintainer']
        except (KeyError, TypeError):  # TypeError: pkgInfo might be None
            data = ProjectProperties.getMaintainerFromFilesystem(
                self.canonicalPath)
        except AssertionError:
            logging.debug('%s: not a canonical path', self.canonicalPath)
            return
        except OSError:
            # unable to determine maintainer from SIT
            return

        if isinstance(data, tuple):
            self.maintainerAccount = data[0]
            self.maintainerName = data[1]

        else:
            Any.requireIsTextNonEmpty(data)
            self.maintainerAccount = data
            self.maintainerName = data
    # 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:
        maintainer = ProjectProperties.getMaintainerFromFilesystem(
            canonicalPath)
        print("%s (%s)" % (canonicalPath, maintainer))

# EOF