summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/reproducible_build.bbclass13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/classes/reproducible_build.bbclass b/meta/classes/reproducible_build.bbclass
index a0fd4d656b..8788ad7145 100644
--- a/meta/classes/reproducible_build.bbclass
+++ b/meta/classes/reproducible_build.bbclass
@@ -22,7 +22,10 @@
22# 3. Use the mtime of "known" files such as NEWS, CHANGLELOG, ... 22# 3. Use the mtime of "known" files such as NEWS, CHANGLELOG, ...
23# This works for well-kept repositories distributed via tarball. 23# This works for well-kept repositories distributed via tarball.
24# 24#
25# 4. If the above steps fail, use the modification time of the youngest file in the source tree. 25# 4. Use the modification time of the youngest file in the source tree, if there is one.
26# This will be the newest file from the distribution tarball, if any.
27#
28# 5. Fall back to a fixed timestamp.
26# 29#
27# Once the value of SOURCE_DATE_EPOCH is determined, it is stored in the recipe's SDE_FILE. 30# Once the value of SOURCE_DATE_EPOCH is determined, it is stored in the recipe's SDE_FILE.
28# If none of these mechanisms are suitable, replace the do_deploy_source_date_epoch task 31# 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):
104 return source_date_epoch 107 return source_date_epoch
105 108
106def get_source_date_epoch_from_youngest_file(d, sourcedir): 109def get_source_date_epoch_from_youngest_file(d, sourcedir):
110 if sourcedir == d.getVar('WORKDIR'):
111 # These sources are almost certainly not from a tarball
112 return None
113
107 # Do it the hard way: check all files and find the youngest one... 114 # Do it the hard way: check all files and find the youngest one...
108 source_date_epoch = None 115 source_date_epoch = None
109 newest_file = None 116 newest_file = None
110 # Just in case S = WORKDIR
111 exclude = set(["build", "image", "license-destdir", "patches", "pseudo",
112 "recipe-sysroot", "recipe-sysroot-native", "sysroot-destdir", "temp"])
113 for root, dirs, files in os.walk(sourcedir, topdown=True): 117 for root, dirs, files in os.walk(sourcedir, topdown=True):
114 files = [f for f in files if not f[0] == '.'] 118 files = [f for f in files if not f[0] == '.']
115 dirs[:] = [d for d in dirs if d not in exclude]
116 119
117 for fname in files: 120 for fname in files:
118 filename = os.path.join(root, fname) 121 filename = os.path.join(root, fname)