Commits

Anonymous committed a3f9a06

Really avoid rebuilding non-live packages.

Use NonLiveEbuild() exception to avoid rebuilding non-live packages
instead of raising a plain Exception() which causes them to be appended
to force-rebuild list along with broken packages.

Comments (0)

Files changed (1)

smart-live-rebuild.py

 	def closetmp(self):
 		self.envtmpf.close()
 
+class NonLiveEbuild(Exception):
+	pass
+
 class VCSSupport:
 	inherit = None
 	reqenv = []
 		if self.env['EGIT_HAS_SUBMODULES'] == 'true':
 			raise NotImplementedError('Submodules are not supported')
 		elif self.env['EGIT_COMMIT'] and self.env['EGIT_COMMIT'] != self.env['EGIT_BRANCH']:
-			raise Exception('EGIT_COMMIT set, package is not really live one')
+			raise NonLiveEbuild('EGIT_COMMIT set, package is not really live one')
 
 	def getpath(self):
 		return '%s/%s' % (self.env['EGIT_STORE_DIR'], self.env['EGIT_PROJECT'])
 	def __init__(self, cpv, env):
 		VCSSupport.__init__(self, cpv, env)
 		if self.env['EHG_REVISION'] and self.env['EHG_REVISION'] != 'tip':
-			raise Exception('EHG_REVISION set, package is not really live one')
+			raise NonLiveEbuild('EHG_REVISION set, package is not really live one')
 
 	def getpath(self):
 		dd = portage.settings['PORTAGE_ACTUAL_DISTDIR'] or portage.settings['DISTDIR']
 	def __init__(self, cpv, env):
 		VCSSupport.__init__(self, cpv, env)
 		if self.env['ESVN_REPO_URI'] and self.env['ESVN_REPO_URI'].find('@') != -1:
-			raise Exception('ESVN_REPO_URI specifies revision, package is not really live one')
+			raise NonLiveEbuild('ESVN_REPO_URI specifies revision, package is not really live one')
 		elif self.env['ESVN_REVISION']:
-			raise Exception('ESVN_REVISION set, package is not really live one')
+			raise NonLiveEbuild('ESVN_REVISION set, package is not really live one')
 
 	def getpath(self):
 		return self.env['ESVN_WC_PATH']
 										rebuilds[dir].append(vcs)
 					except KeyboardInterrupt:
 						raise
+					except NonLiveEbuild as e:
+						out.err('%s: %s' % (cpv, e))
 					except Exception as e:
 						out.err('Error enumerating %s: [%s] %s' % (cpv, e.__class__.__name__, e))
 						erraneous.append(cpv)