Skip to content

Commit

Permalink
fix two reproducible build issues
Browse files Browse the repository at this point in the history
Fixed two reproducible builds issues found by Bernhard Wiedemann.

Signed-off-by: Marcus Meissner <[email protected]>
  • Loading branch information
msmeissn committed Dec 10, 2024
1 parent b3b1560 commit 4168cca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 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,7 @@ 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
10 changes: 6 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,11 @@ 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()
#try:
# return datetime.datetime.now(datetime.UTC).isoformat()
#except AttributeError:
# return datetime.datetime.utcnow().isoformat()


def create_tailoring(args):
Expand Down

0 comments on commit 4168cca

Please sign in to comment.