]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Annotate vpnc-script-win.js with a header documenting its exact source revision
authorDaniel Lenski <dlenski@gmail.com>
Fri, 24 Sep 2021 22:50:53 +0000 (22:50 +0000)
committerDaniel Lenski <dlenski@gmail.com>
Fri, 24 Sep 2021 22:50:53 +0000 (22:50 +0000)
By annotating the vpnc-script-win.js included in the Windows installers
with information about the exact source revision, we will ease reporting
and reduce confusion about problems resulting from interactions between
OpenConnect and vpnc-script.

Example of the header added to vpnc-script-win.js:

    // This script matches the version found at https://gitlab.com/openconnect/vpnc-scripts/-/blob/b749c2cadc2f32e2efffa69302861f9a7d4a4e5f/vpnc-script-win.js
    // Updated on 2021-09-24 by Daniel Lenski <dlenski@gmail.com> ("Ensure that vpnc-script-win.js works even if INTERNAL_IP4_{NETADDR,NETMASK} are unset")
    //

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Makefile.am

index 7e96316f5012eb3ca0f951a5f3e32b62782752e1..65d2e71e3efda1589b5a86dfab82708d339ef0dd 100644 (file)
@@ -1,4 +1,3 @@
-
 SUBDIRS = tests
 # We kind of want openconnect to be built before we try to test it
 check-recursive: openconnect$(EXEEXT)
@@ -305,9 +304,12 @@ $(WINTUNDRIVER):
        echo $(WINTUNSHA256) $< | sha256sum -c
        unzip -DD -o -j -d .libs $< wintun/bin/$(WINTUN_ARCH)/wintun.dll
 
-# Latest vpnc-script-win.js
+# Latest vpnc-script-win.js, annotated with a header documenting the
+# exact source revision.
 vpnc-script-win.js:
-       curl https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js -o $@
+       curl 'https://gitlab.com/api/v4/projects/openconnect%2Fvpnc-scripts/repository/commits?path=vpnc-script-win.js&branch=master' | \
+           jq -r '.[0] | "// This script matches the version found at " + (.web_url | sub("/commit/"; "/blob/")) + "/vpnc-script-win.js\n// Updated on " + .authored_date[:10] + " by " + .author_name + " <" + .author_email + "> (\"" + .title + "\")\n//"' > $@
+       curl https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js >> $@
 
 # Let make find the file in VPATH
 file-list-%.txt: %