Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
legoktm committed Aug 8, 2023
1 parent ca8d70f commit 73e82e1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/publish-real
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
Script for generating yum repository metadata. Files are
copied into public/ and metadata is generated there.
"""
import argparse
import os
import shutil
import subprocess
from pathlib import Path


def main():
parser = argparse.ArgumentParser(description="Build yum repodata metadata")
parser.add_argument("--reproduce", action="store_true", help="Reproduce the current metadata")
source_date_epoch = int(os.environ.get("SOURCE_DATE_EPOCH", 0))
root = Path(__file__).parent.parent
public = root / "public"
workstation = root / "workstation"
Expand All @@ -18,20 +22,24 @@ def main():
shutil.rmtree(public)
public.mkdir()
shutil.copytree(workstation, public / "workstation")
if source_date_epoch:
for rpm in public.glob("**/*.rpm"):
print(f"touching {rpm}")
os.utime(rpm, times=(source_date_epoch, source_date_epoch))
# Folders are public/workstation/dom0/fXX, run createrepo_c in each one
for folder in public.glob("*/*/*/"):
if not folder.is_dir():
continue
print(f"Generating metadata for {folder}")
args = ["createrepo_c"]
if "SOURCE_DATE_EPOCH" in os.environ:
if source_date_epoch:
# The <revision> and <timestamp> fields are set to the current UNIX time
# unless we explicitly override them. In most cases we want to use
# the current time except when we're doing reproducibility testing.
args.extend(
[
"--revision",
os.environ["SOURCE_DATE_EPOCH"],
str(source_date_epoch),
"--set-timestamp-to-revision",
]
)
Expand Down

0 comments on commit 73e82e1

Please sign in to comment.