mirror of
https://git.busybox.net/buildroot.git
synced 2024-11-23 13:33:28 +08:00
scripts/support/cve.py: avoid a complete clone of the CVE git repository
Just a simple clone and pull with --depth 1 should be enough to parse the CVE data and generate the pkg-stats report. From a full clone and a depth-1 clone, and the size delta is 2.9GiB vs. 2.2GiB. The download size does change: from 983.55MiB down to 270.78MiB. It's a net time win too: 2m17s vs 1min7s (on a 100Mbps link). Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
37801767f6
commit
e0ed05cc00
@ -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"],
|
||||
["git", "pull", "--depth", "1"],
|
||||
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", NVD_BASE_URL, nvd_git_dir],
|
||||
["git", "clone", "--depth", "1", NVD_BASE_URL, nvd_git_dir],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user