diff options
author | Douglas Royds <douglas.royds@taitradio.com> | 2018-11-23 09:41:56 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-08 20:14:42 +0000 |
commit | e2a2f8cd895245a7f126afb125e094a0b8bbce33 (patch) | |
tree | 0ceeec4338753d9542a67cf119482c9c3e9b6d81 /meta/classes | |
parent | d513b1d6bba1ac93c1fb295ec0c2571ab0509dbc (diff) | |
download | poky-e2a2f8cd895245a7f126afb125e094a0b8bbce33.tar.gz |
reproducible: Refactor: Break out fixed_source_date_epoch() function
(From OE-Core rev: 4eb6def4fe82959c2a348142b9eada27d3354aef)
(From OE-Core rev: 98b7d22ed563efdf58beba1ba65270b731673103)
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>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/reproducible_build.bbclass | 9 |
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 | ||
131 | def fixed_source_date_epoch(): | ||
132 | bb.debug(1, "No tarball or git repo found to determine SOURCE_DATE_EPOCH") | ||
133 | return 0 | ||
134 | |||
131 | python do_create_source_date_epoch_stamp() { | 135 | python 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')) |