kernel/reproducibility: use specified environment settings

Submitted by Bruce Ashfield on May 13, 2020, 2:36 p.m. | Patch ID: 172551

Details

Message ID 20200513143618.53411-1-bruce.ashfield@gmail.com
State Master Next
Commit 5ee8e89eec089241c562441c11dc487cdff9dfb3
Headers show

Commit Message

Bruce Ashfield May 13, 2020, 2:36 p.m.
From: Bruce Ashfield <bruce.ashfield@gmail.com>

The routine to get the timestamp of the kernel commits should
specify LC_ALL to ensure consistent behaviour. We were making
a copy of the env, adding the setting .. and then not using it
on the call.

We specifiy the env in the subprocess call to ensure the
variable is available.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---

This is the incremental patch to my previous series. Squash as required!

Bruce

 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index f31084948f..3ac91fbd4f 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -164,7 +164,7 @@  def get_kernel_source_date_epoch(d):
 
     env = os.environ.copy()
     env['LC_ALL'] = 'C'
-    ts = subprocess.check_output(['date', '-d @%s' % s_d_e]).decode('utf-8')
+    ts = subprocess.check_output(['date', '-d @%s' % s_d_e], env=env).decode('utf-8')
 
     return ts