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>
-
SUBDIRS = tests
# We kind of want openconnect to be built before we try to test it
check-recursive: openconnect$(EXEEXT)
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: %