fetch_sources: can remove a tag before fetching
authorDavid Neto <dneto@google.com>
Wed, 10 Oct 2018 00:23:54 +0000 (20:23 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 18 Oct 2018 07:23:16 +0000 (03:23 -0400)
Glslang's master-tot tag moves around, which causes subsequent fetches
to fail. Forcibly remove it before fetching.

Change-Id: I18233e49cfac8652e4e6a56732cb1b4215488781
Component: Framework
VK-GL-CTS issue: 1412

external/fetch_sources.py

index 83306d2..6ef32e6 100644 (file)
@@ -176,11 +176,12 @@ class SourcePackage (Source):
                        self.postExtract(dstPath)
 
 class GitRepo (Source):
-       def __init__(self, httpsUrl, sshUrl, revision, baseDir, extractDir = "src"):
+       def __init__(self, httpsUrl, sshUrl, revision, baseDir, extractDir = "src", removeTags = []):
                Source.__init__(self, baseDir, extractDir)
                self.httpsUrl   = httpsUrl
                self.sshUrl             = sshUrl
                self.revision   = revision
+               self.removeTags = removeTags
 
        def detectProtocol(self, cmdProtocol = None):
                # reuse parent repo protocol
@@ -228,6 +229,11 @@ class GitRepo (Source):
 
                pushWorkingDir(fullDstPath)
                try:
+                       for tag in self.removeTags:
+                               proc = subprocess.Popen(['git', 'tag', '-l', tag], stdout=subprocess.PIPE)
+                               (stdout, stderr) = proc.communicate()
+                               if proc.returncode == 0:
+                                       execute(["git", "tag", "-d",tag])
                        execute(["git", "fetch", "--tags", url, "+refs/heads/*:refs/remotes/origin/*"])
                        execute(["git", "checkout", self.revision])
                finally:
@@ -258,7 +264,8 @@ PACKAGES = [
                "https://github.com/KhronosGroup/glslang.git",
                None,
                "5ff3c3da3b374a03a5eff96544fcd6678ed575c1",
-               "glslang"),
+               "glslang",
+               removeTags = ['master-tot']),
        GitRepo(
                "https://github.com/KhronosGroup/SPIRV-Headers.git",
                None,