Skip to content

Commit

Permalink
Merge pull request #12696 from msmeissn/master
Browse files Browse the repository at this point in the history
fix two reproducible build issues
  • Loading branch information
Mab879 authored Dec 18, 2024
2 parents 80a8fa8 + d561c6a commit 7da0de1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 5 additions & 1 deletion ssg/build_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
import datetime
import time
import json
import os
import os.path
Expand Down Expand Up @@ -741,7 +742,10 @@ def _create_benchmark_xml_skeleton(self, env_yaml):
root.set('xml:lang', 'en-US')

status = ET.SubElement(root, '{%s}status' % XCCDF12_NS)
status.set('date', datetime.date.today().strftime("%Y-%m-%d"))
status.set(
'date',
time.strftime("%Y-%m-%d",
time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))))
status.text = self.status

add_sub_element(root, "title", XCCDF12_NS, self.title)
Expand Down
7 changes: 3 additions & 4 deletions utils/create_scap_delta_tailoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import datetime
import time
import json
import os
import re
Expand Down Expand Up @@ -165,10 +166,8 @@ def setup_tailoring_profile(profile_id, profile_root):


def _get_datetime():
try:
return datetime.datetime.now(datetime.UTC).isoformat()
except AttributeError:
return datetime.datetime.utcnow().isoformat()
return datetime.datetime.fromtimestamp(
int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))).isoformat()


def create_tailoring(args):
Expand Down

0 comments on commit 7da0de1

Please sign in to comment.