Add the optional Time key to the vx.y.z.info file. This should help
https://pkg.go.dev/libguestfs.org/libnbd to show the "Published" date.
Using the commit date so rebuilding the tarball will created identical
metadata.
$ cat
libguestfs.org/libnbd/@latest
{
"Version": "v1.11.3-9-g157bc49",
"Time": "2021-11-08"
}
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
v2 changes:
- Use git commit date for reproducible builds (Richard)
- Create indented json
golang/make-dist.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/golang/make-dist.sh b/golang/make-dist.sh
index 1aef36c..32b9735 100755
--- a/golang/make-dist.sh
+++ b/golang/make-dist.sh
@@ -100,8 +100,12 @@ v_dir=$module_dir/@v
mkdir -p $v_dir
-echo "{\"Version\": \"$version\"}" >
$module_dir/@latest
-echo "{\"Version\": \"$version\"}" >
$v_dir/$version.info
+info="{
+ \"Version\": \"$version\",
+ \"Time\": \"$(git show -s --format=%cs)\"
+}"
+echo "$info" > $module_dir/@latest
+echo "$info" > $v_dir/$version.info
# This is not entirely correct. This file should have a list of all
# versions available, here we create only single version. This should
--
2.31.1