Merge ~rodrigo-zaiden/ubuntu-cve-tracker:process-cve-missing-redhat into ubuntu-cve-tracker:master

Proposed by Rodrigo Figueiredo Zaiden
Status: Merged
Merged at revision: 6a938f3dabe6673ee1d9ad7df50001dacfba820f
Proposed branch: ~rodrigo-zaiden/ubuntu-cve-tracker:process-cve-missing-redhat
Merge into: ubuntu-cve-tracker:master
Diff against target: 14 lines (+2/-2)
1 file modified
scripts/process_cves (+2/-2)
Reviewer Review Type Date Requested Status
Steve Beattie Approve
Review via email: mp+427298@code.launchpad.net

Commit message

process_cves: add simplest locale in missing_redhat

Description of the change

in a non trivial installation, when running `./scripts/process_cves redhat`, the `date` command can return an invalid value like below:

  ./scripts/process_cves redhat
  Downloading https://www.redhat.com/archives/rhsa-announce/2022-julho.txt.gz...
  Unzipping /tmp/tmp.Ckl3I22me7/2022-julho.txt.gz...

adding `LC_TIME=C` before the call to `date` can fix it for those non trivial environment and guarantee to hit the correct file in rhsa-announce list.

To post a comment you must log in.
Revision history for this message
Steve Beattie (sbeattie) wrote :

LGTM, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/process_cves b/scripts/process_cves
2index 1af01bd..0200cf5 100755
3--- a/scripts/process_cves
4+++ b/scripts/process_cves
5@@ -184,8 +184,8 @@ download_rhel8oval() {
6
7 process_missing_redhat() {
8 tmpdir=$(mktemp -d)
9- download_missing_rhsa "$tmpdir" "$(date +%Y-%B)"
10- download_missing_rhsa "$tmpdir" "$(date --date="$(date +%Y-%m-15) -1 month" +%Y-%B)"
11+ download_missing_rhsa "$tmpdir" "$(LC_TIME=C date +%Y-%B)"
12+ download_missing_rhsa "$tmpdir" "$(LC_TIME=C date --date="$(date +%Y-%m-15) -1 month" +%Y-%B)"
13 ./scripts/check-cves --untriaged "$tmpdir/redhat.mbox"
14 rm -rf "$tmpdir"
15

Subscribers

People subscribed via source and target branches