summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-05-21 16:05:03 +0000
committerMarius Mauch <genone@gentoo.org>2008-05-21 16:05:03 +0000
commite07fefd05857b5322aa2991ac2c2042245e1d836 (patch)
treeba2ce0c7c4a0d1d15078b13f7b9c94850f039e83
parentWhen using vecho or eqawarn it comes in handy when isolated-functions (diff)
downloadportage-multirepo-2.2_pre7.tar.gz
portage-multirepo-2.2_pre7.tar.bz2
portage-multirepo-2.2_pre7.zip
Raise an error if the named repository doesn't existv2.2_pre7
svn path=/main/trunk/; revision=10383
-rw-r--r--pym/portage/sets/files.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage/sets/files.py b/pym/portage/sets/files.py
index bf9f9e6e..b03a60e9 100644
--- a/pym/portage/sets/files.py
+++ b/pym/portage/sets/files.py
@@ -101,7 +101,10 @@ class StaticFileSet(EditablePackageSet):
# look for repository path variables
match = self._repopath_match.match(filename)
if match:
- filename = self._repopath_sub.sub(trees["porttree"].dbapi.treemap[match.groupdict()["reponame"]], filename)
+ try:
+ filename = self._repopath_sub.sub(trees["porttree"].dbapi.treemap[match.groupdict()["reponame"]], filename)
+ except KeyError:
+ raise SetConfigError("Could not find repository '%s'" % match.groupdict()["reponame"])
return StaticFileSet(filename, greedy=greedy, dbapi=trees["vartree"].dbapi)
singleBuilder = classmethod(singleBuilder)
@@ -115,7 +118,10 @@ class StaticFileSet(EditablePackageSet):
# look for repository path variables
match = self._repopath_match.match(directory)
if match:
- directory = self._repopath_sub.sub(trees["porttree"].dbapi.treemap[match.groupdict()["reponame"]], directory)
+ try:
+ directory = self._repopath_sub.sub(trees["porttree"].dbapi.treemap[match.groupdict()["reponame"]], directory)
+ except KeyError:
+ raise SetConfigError("Could not find repository '%s'" % match.groupdict()["reponame"])
if os.path.isdir(directory):
for filename in os.listdir(directory):
if filename.endswith(".metadata"):