[jhbuild] git: when exporting properly get the tag



commit c1724d94b8a1667b3bfbb6595aa100ce526a099d
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Mon Jul 29 16:35:50 2019 +0200

    git: when exporting properly get the tag
    
    It might be the tag is not set in the moduleset, so better
    get the tag from the HEAD

 jhbuild/versioncontrol/git.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index 6a0e82b4..5e17f79a 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -369,7 +369,15 @@ class GitBranch(Branch):
     def _export(self, buildscript):
         self._checkout(buildscript)
 
-        filename = self.get_module_basename() + '-' + self.tag + '.zip'
+        try:
+            output = get_output(['git', 'rev-parse', 'HEAD'],
+                    cwd = self.get_checkoutdir(), get_stderr=False,
+                    extra_env=get_git_extra_env())
+            tag = output.strip()
+        except:
+            tag = 'unknown'
+
+        filename = self.get_module_basename() + '-' + tag + '.zip'
 
         if self.config.export_dir is not None:
             path = os.path.join(self.config.export_dir, filename)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]