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:28:31 +0000 (09:28 +0200)
Glslang's master-tot tag moves around, which causes subsequent fetches
to fail. Forcibly remove it before fetching.

Component: Framework
VK-GL-CTS issue: 1412

Change-Id: I18233e49cfac8652e4e6a56732cb1b4215488781
(cherry picked from commit 595262f42a6653b225a42a990b10c69c99f5374d)

external/fetch_sources.py

index acf7d98..4c37f79 100755 (executable)
@@ -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,
                "e9405d0b443a1849fa55b7bfeaceda586a1c37af",
-               "glslang"),
+               "glslang",
+               removeTags = ['master-tot']),
        GitRepo(
                "https://github.com/KhronosGroup/SPIRV-Headers.git",
                None,