]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix "srcid" on Windows
authorMichał Kępień <michal@isc.org>
Wed, 15 Apr 2020 09:38:40 +0000 (11:38 +0200)
committerMichał Kępień <michal@isc.org>
Wed, 15 Apr 2020 09:39:55 +0000 (11:39 +0200)
Windows BIND releases produced by GitLab CI are built from Git
repositories, not from release tarballs, which means the "srcid" file is
not present in the top source directory when MSBuild is invoked.  This
causes the Git commit hash for such builds to be set to "unset_id".
Enable win32utils/Configure to try determining the commit hash for a
build by invoking Git on the build host if the "srcid" file is not
present (which is what its Unix counterpart does).

(cherry picked from commit 05e13e7cafaff48b5e3bb098114225df89f3e59c)

win32utils/Configure

index 79d682ef5b481aa058c7b4cbbd4ac2132707b9d6..e8d3f7323debb745f0d1ce2cd0f3d0c5f5b7a6c3 100644 (file)
@@ -3389,6 +3389,13 @@ sub makesrcid {
         close SIN;
     }
 
+    if ($srcid eq "unset_id" and -d "..\\.git") {
+        $data = `git rev-list --max-count=1 HEAD`;
+        if (length($data) > 0) {
+            $srcid = substr($data, 0, 7);
+        }
+    }
+
     # Now set up the output version file
 
     my $ThisDate = scalar localtime();