Make FindPortdir() return (None, None, None) on failure, instead of raising
authorZac Medico <zmedico@gentoo.org>
Tue, 11 Nov 2008 17:46:49 +0000 (17:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 11 Nov 2008 17:46:49 +0000 (17:46 -0000)
a potentially ambiguous ValueError.

svn path=/main/trunk/; revision=11853

bin/repoman
pym/repoman/utilities.py

index 5db3b60777e647a2be82c58dbccdb148830df592..f9900781a6173b939c9af9f13d756ae69b71004a 100755 (executable)
@@ -481,9 +481,8 @@ if options.mode in ('last', 'lfull'):
 # commit (like if Manifest generation fails).
 can_force = True
 
-try:
-       portdir, portdir_overlay, mydir = utilities.FindPortdir(repoman_settings)
-except ValueError:
+portdir, portdir_overlay, mydir = utilities.FindPortdir(repoman_settings)
+if portdir is None:
        sys.exit(1)
 
 vcs = None
index cc654154cdeecbb0b0052e44d08ade4556295f62..807ff1ba9557b30ca37b177493cf400dadd07996 100644 (file)
@@ -393,7 +393,7 @@ def FindPortdir(settings):
                msg = 'Repoman is unable to determine PORTDIR or PORTDIR_OVERLAY' + \
                        ' from the current working directory'
                logging.critical(msg)
-               raise ValueError(msg)
+               return (None, None, None)
 
        if not portdir:
                portdir = settings["PORTDIR"]