Michał Górny committed 3703adf

Fix handling implicit git-r3 inherit in git-2 properly.

Check which of the eclasses was intended, and skip the other.

Comments (0)

Files changed (4)


 from .filtering import PackageFilter
 from .output import out
-from .vcs import NonLiveEbuild
+from .vcs import NonLiveEbuild, OtherEclass
 from .vcsload import VCSLoader
 class SLRFailure(Exception):
 					except NonLiveEbuild as e:
 						out.s2('[%s]' % pkg.slotted_atom)
 						out.s3('%s%s%s' % (out.brown, e, out.reset))
+					except OtherEclass:
+						pass
 					except Exception as e:
 						if opts.debug:


 		and will not cause rebuild of the package. """
+class OtherEclass(Exception):
+	""" Exception to be raised whenever the package will use another
+		eclass and the current needs to be silently terminated. """
+	pass
 class BaseVCSSupport(ABCObject):
 	""" Common VCS support class details. """
 	_running = False


 from .git_r3 import GitR3Support
 class Git2Support(GitR3Support):
-	pass
+	def __init__(self, *args, **kwargs):
+		kwargs['want_r3'] = False
+		GitR3Support.__init__(self, *args, **kwargs)


 # (c) 2011 Michał Górny <>
 # Released under the terms of the 2-clause BSD license.
-from . import RemoteVCSSupport, NonLiveEbuild
+from . import RemoteVCSSupport, NonLiveEbuild, OtherEclass
 class GitR3Support(RemoteVCSSupport):
 	reqenv = ['EGIT_REPO_URI', 'EGIT_VERSION']
-	optenv = ['EGIT_BRANCH', 'EGIT_COMMIT']
-	def __init__(self, *args, **kwargs):
+	def __init__(self, *args, want_r3=True, **kwargs):
 		RemoteVCSSupport.__init__(self, *args, **kwargs)
 		if (self.env['EGIT_COMMIT']
 				and self.env['EGIT_COMMIT'] != (self.env.get('EGIT_BRANCH') or HEAD)):
 			raise NonLiveEbuild('EGIT_COMMIT set, package is not really a live one')
 		self.repo_uris = self.env['EGIT_REPO_URI'].split()
+		if want_r3 != bool(self.env['EGIT_MASTER']):
+			raise OtherEclass()
 	def __str__(self):
 		return '%s [%s]' % (self.repo_uris[0],
 				self.env.get('EGIT_BRANCH') or 'HEAD')