Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly set mtime on all repo contents #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import os
import subprocess
import sys
import time
import logging

# Look for a specific version of modulemd. The 1.x series does not
Expand Down Expand Up @@ -406,6 +407,9 @@ def create_repos(target, repos, def_modules, only_defaults):
list of repositories.
Returns None
"""

time_ns = time.clock_gettime_ns(time.CLOCK_REALTIME)

for modname in repos:
if only_defaults and modname not in def_modules:
continue
Expand All @@ -423,6 +427,13 @@ def create_repos(target, repos, def_modules, only_defaults):
os.path.join(targetdir, 'repodata')
])

# Make sure that all generated repos share identical mtimes
# to avoid issues with mergerepo_c
for root, dirs, files in os.walk(targetdir, followlinks=True):
del dirs
for name in files:
os.utime(os.path.join(root, name), ns=(time_ns, time_ns))


def parse_args():
"""
Expand Down