From 2cb286c8a22980656673f0f3fa566fbaa57efd64 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Thu, 12 Sep 2024 12:39:20 +0200 Subject: [PATCH] Revert "scripts/support/cve.py: avoid a complete clone of the CVE git repository" This reverts commit e0ed05cc007eed630dd44b7f129903a76fab6981. Since this commit has been applied, the update of the NVD data fails: Checking packages CVEs Updating from https://github.com/fkie-cad/nvd-json-data-feeds/ Traceback (most recent call last): File "/home/buildroot/buildroot-stats/./support/scripts/pkg-stats", line 1346, in __main__() File "/home/buildroot/buildroot-stats/./support/scripts/pkg-stats", line 1335, in __main__ check_package_cves(args.nvd_path, packages) File "/home/buildroot/buildroot-stats/./support/scripts/pkg-stats", line 660, in check_package_cves for cve in cvecheck.CVE.read_nvd_dir(nvd_path): File "/home/buildroot/buildroot-stats/support/scripts/cve.py", line 105, in read_nvd_dir CVE.download_nvd(nvd_git_dir) File "/home/buildroot/buildroot-stats/support/scripts/cve.py", line 74, in download_nvd subprocess.check_call( File "/usr/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['git', 'pull', '--depth', '1']' returned non-zero exit status 128. Since we couldn't immediately figure out what's going on, let's revert for now until this get investigated and fixed. Signed-off-by: Thomas Petazzoni --- support/scripts/cve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/scripts/cve.py b/support/scripts/cve.py index dcb3a63925..e25825581e 100755 --- a/support/scripts/cve.py +++ b/support/scripts/cve.py @@ -72,7 +72,7 @@ class CVE: print(f"Updating from {NVD_BASE_URL}") if os.path.exists(nvd_git_dir): subprocess.check_call( - ["git", "pull", "--depth", "1"], + ["git", "pull"], cwd=nvd_git_dir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, @@ -82,7 +82,7 @@ class CVE: # happily clones into an empty directory. os.makedirs(nvd_git_dir) subprocess.check_call( - ["git", "clone", "--depth", "1", NVD_BASE_URL, nvd_git_dir], + ["git", "clone", NVD_BASE_URL, nvd_git_dir], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, )