summaryrefslogtreecommitdiffstats
path: root/meta/classes/reproducible_build.bbclass
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:35:19 +0000
commit59c8937095484af986469a2aa65fb729202327a2 (patch)
tree2e7ffaebb4e11e078b8375c4f0af4686ff98c26c /meta/classes/reproducible_build.bbclass
parentf9991cb875deca90e7d6a4b9ad25ddac381d1ee1 (diff)
downloadpoky-59c8937095484af986469a2aa65fb729202327a2.tar.gz
reproducible: Refactor: Break out fixed_source_date_epoch() function
(From OE-Core rev: 4eb6def4fe82959c2a348142b9eada27d3354aef) Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/reproducible_build.bbclass')
-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):
128 bb.debug(1, "Newest file found: %s" % newest_file) 128 bb.debug(1, "Newest file found: %s" % newest_file)
129 return source_date_epoch 129 return source_date_epoch
130 130
131def fixed_source_date_epoch():
132 bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH")
133 return 0
134
131python do_create_source_date_epoch_stamp() { 135python do_create_source_date_epoch_stamp() {
132 epochfile = d.getVar('SDE_FILE') 136 epochfile = d.getVar('SDE_FILE')
133 if os.path.isfile(epochfile): 137 if os.path.isfile(epochfile):
@@ -139,11 +143,8 @@ python do_create_source_date_epoch_stamp() {
139 get_source_date_epoch_from_git(d, sourcedir) or 143 get_source_date_epoch_from_git(d, sourcedir) or
140 get_source_date_epoch_from_known_files(d, sourcedir) or 144 get_source_date_epoch_from_known_files(d, sourcedir) or
141 get_source_date_epoch_from_youngest_file(d, sourcedir) or 145 get_source_date_epoch_from_youngest_file(d, sourcedir) or
142 0 # Last resort 146 fixed_source_date_epoch() # Last resort
143 ) 147 )
144 if source_date_epoch == 0:
145 # empty folder, not a single file ...
146 bb.debug(1, "No files found to determine SOURCE_DATE_EPOCH")
147 148
148 bb.debug(1, "SOURCE_DATE_EPOCH: %d" % source_date_epoch) 149 bb.debug(1, "SOURCE_DATE_EPOCH: %d" % source_date_epoch)
149 bb.utils.mkdirhier(d.getVar('SDE_DIR')) 150 bb.utils.mkdirhier(d.getVar('SDE_DIR'))