aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Royds <douglas.royds@taitradio.com>2018-11-23 09:41:56 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-23 23:32:10 +0000
commit4eb6def4fe82959c2a348142b9eada27d3354aef (patch)
treeb15bf328158a53be577388b6cd82bd4f3b403318
parent5ff5f89f2db079a6baf0275ebf1333b4b9642504 (diff)
downloadopenembedded-core-contrib-4eb6def4fe82959c2a348142b9eada27d3354aef.tar.gz
reproducible: Refactor: Break out fixed_source_date_epoch() function
Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/reproducible_build.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/reproducible_build.bbclass b/meta/classes/reproducible_build.bbclass
index 0eb696ac78..a0fd4d656b 100644
--- a/meta/classes/reproducible_build.bbclass
+++ b/meta/classes/reproducible_build.bbclass
@@ -128,6 +128,10 @@ def get_source_date_epoch_from_youngest_file(d, sourcedir):
bb.debug(1, "Newest file found: %s" % newest_file)
return source_date_epoch
+def fixed_source_date_epoch():
+ bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH")
+ return 0
+
python do_create_source_date_epoch_stamp() {
epochfile = d.getVar('SDE_FILE')
if os.path.isfile(epochfile):
@@ -139,11 +143,8 @@ python do_create_source_date_epoch_stamp() {
get_source_date_epoch_from_git(d, sourcedir) or
get_source_date_epoch_from_known_files(d, sourcedir) or
get_source_date_epoch_from_youngest_file(d, sourcedir) or
- 0 # Last resort
+ fixed_source_date_epoch() # Last resort
)
- if source_date_epoch == 0:
- # empty folder, not a single file ...
- bb.debug(1, "No files found to determine SOURCE_DATE_EPOCH")
bb.debug(1, "SOURCE_DATE_EPOCH: %d" % source_date_epoch)
bb.utils.mkdirhier(d.getVar('SDE_DIR'))