mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 18:32:15 +02:00
reproducible: Don't look for youngest file when no source tarball
Some packages (eg. init-ifupdown) take their source files entirely from openembedded-core, that is, they download no source tarball. These recipes either don't use S at all (ie. it is empty at unpack time), or they set S = WORKDIR (as in init-ifupdown). Looking at the file timestamps in the WORKDIR causes a non-reproducible SOURCE_DATE_EPOCH, as files taken from file:// URIs do not have reproducible timestamps. If S == WORKDIR, we are better to assume that there is no source tarball, and to fall back to a fixed timestamp for the SOURCE_DATE_EPOCH. This makes the init-ifupdown build reproducible. (From OE-Core rev: d395bad0179037eb5d0fa4d921985c87ae13f3a4) (From OE-Core rev: cd56795a1588d780ca6a0cb974bf4024ab636be7) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e2a2f8cd89
commit
c90a56ed6d
@@ -22,7 +22,10 @@
|
||||
# 3. Use the mtime of "known" files such as NEWS, CHANGLELOG, ...
|
||||
# This works for well-kept repositories distributed via tarball.
|
||||
#
|
||||
# 4. If the above steps fail, use the modification time of the youngest file in the source tree.
|
||||
# 4. Use the modification time of the youngest file in the source tree, if there is one.
|
||||
# This will be the newest file from the distribution tarball, if any.
|
||||
#
|
||||
# 5. Fall back to a fixed timestamp.
|
||||
#
|
||||
# Once the value of SOURCE_DATE_EPOCH is determined, it is stored in the recipe's SDE_FILE.
|
||||
# If none of these mechanisms are suitable, replace the do_deploy_source_date_epoch task
|
||||
@@ -104,15 +107,15 @@ def get_source_date_epoch_from_git(d, sourcedir):
|
||||
return source_date_epoch
|
||||
|
||||
def get_source_date_epoch_from_youngest_file(d, sourcedir):
|
||||
if sourcedir == d.getVar('WORKDIR'):
|
||||
# These sources are almost certainly not from a tarball
|
||||
return None
|
||||
|
||||
# Do it the hard way: check all files and find the youngest one...
|
||||
source_date_epoch = None
|
||||
newest_file = None
|
||||
# Just in case S = WORKDIR
|
||||
exclude = set(["build", "image", "license-destdir", "patches", "pseudo",
|
||||
"recipe-sysroot", "recipe-sysroot-native", "sysroot-destdir", "temp"])
|
||||
for root, dirs, files in os.walk(sourcedir, topdown=True):
|
||||
files = [f for f in files if not f[0] == '.']
|
||||
dirs[:] = [d for d in dirs if d not in exclude]
|
||||
|
||||
for fname in files:
|
||||
filename = os.path.join(root, fname)
|
||||
|
||||
Reference in New Issue
Block a user