Otherwise https://git.kernel.org/pub/scm/linux/security/vulns.git cannot be
used:
subprocess.CalledProcessError: Command '('git', 'describe', '--tags', 'HEAD')' returned non-zero exit status 128.
Original error from git:
fatal: No names found, cannot describe anything.
The change will at least produce an abbreviated SHA1 hash as {data_version}.
Fixes: 5e66e2b79fae ("linux/generate-cve-exclusions: show the name and version of the data source")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
version = args.version
base_version = Version(f"{version.major}.{version.minor}")
- data_version = subprocess.check_output(("git", "describe", "--tags", "HEAD"), cwd=datadir, text=True)
+ data_version = subprocess.check_output(("git", "describe", "--tags", "--always", "HEAD"), cwd=datadir, text=True)
print(f"""
# Auto-generated CVE metadata, DO NOT EDIT BY HAND.