Commits

Michał Górny  committed 89331a2

Fix EGIT_COMMIT support.

First of all, the variable has to be declared in optenv. Secondly,
git.eclass defaults it to the branch name, so we need to check it more
thoroughly.

Comparing it to EGIT_BRANCH may not be the best method to check if user
requested a particular commit (and not branch, for example) but that's
how the eclass does it and it should be sufficient for now.

  • Participants
  • Parent commits 840c9dc

Comments (0)

Files changed (1)

File smart-live-rebuild.py

 class GitSupport(VCSSupport):
 	inherit = 'git'
 	reqenv = ['EGIT_BRANCH', 'EGIT_PROJECT', 'EGIT_STORE_DIR', 'EGIT_UPDATE_CMD']
-	optenv = ['EGIT_DIFFSTAT_CMD', 'EGIT_HAS_SUBMODULES', 'EGIT_OPTIONS', 'EGIT_REPO_URI', 'EGIT_VERSION']
+	optenv = ['EGIT_COMMIT', 'EGIT_DIFFSTAT_CMD', 'EGIT_HAS_SUBMODULES', 'EGIT_OPTIONS', 'EGIT_REPO_URI', 'EGIT_VERSION']
 
 	def __init__(self, cpv, env):
 		VCSSupport.__init__(self, cpv, env)
 		if self.env['EGIT_HAS_SUBMODULES'] == 'true':
 			raise NotImplementedError('Submodules are not supported')
-		elif self.env['EGIT_COMMIT']:
+		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')
 
 	def getpath(self):