public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10383 - main/trunk/pym/portage/sets
@ 2008-05-21 16:05 Marius Mauch (genone)
  0 siblings, 0 replies; only message in thread
From: Marius Mauch (genone) @ 2008-05-21 16:05 UTC (permalink / raw
  To: gentoo-commits

Author: genone
Date: 2008-05-21 16:05:03 +0000 (Wed, 21 May 2008)
New Revision: 10383

Modified:
   main/trunk/pym/portage/sets/files.py
Log:
Raise an error if the named repository doesn't exist

Modified: main/trunk/pym/portage/sets/files.py
===================================================================
--- main/trunk/pym/portage/sets/files.py	2008-05-20 19:52:59 UTC (rev 10382)
+++ main/trunk/pym/portage/sets/files.py	2008-05-21 16:05:03 UTC (rev 10383)
@@ -101,7 +101,10 @@
 		# 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 @@
 		# 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"):

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-21 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 16:05 [gentoo-commits] portage r10383 - main/trunk/pym/portage/sets Marius Mauch (genone)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox