From: Zac Medico Date: Tue, 2 Mar 2010 20:08:44 +0000 (-0000) Subject: Add a portdbapi.getRepositoryName() method which is the inverse of X-Git-Tag: v2.1.8~164 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=318dc27dad39012f2d525491eb1215c84aa22dc6;p=portage.git Add a portdbapi.getRepositoryName() method which is the inverse of getRepositoryPath(). (trunk r15325) svn path=/main/branches/2.1.7/; revision=15558 --- diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index cf7eeac7f..5a845118d 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -452,6 +452,18 @@ class portdbapi(dbapi): return self.treemap[repository_id] return None + def getRepositoryName(self, canonical_repo_path): + """ + This is the inverse of getRepositoryPath(). + @param canonical_repo_path: the canonical path of a repository, as + resolved by os.path.realpath() + @type canonical_repo_path: String + @returns: The repo_name for the corresponding repository, or None + if the path does not correspond a known repository + @rtype: String or None + """ + return self._repository_map.get(canonical_repo_path) + def getRepositories(self): """ This function is required for GLEP 42 compliance; it will return a list of