From f454a3cf595e1e3525449f0d658be355f1fa6fc9 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 25 Nov 2016 19:42:02 +0100 Subject: [PATCH] files: fix corner-case in SourceID calculation If either copy, patch or unpack attribute of a file entry is set to the string "nil" with everything else being equal, the SourceID does not change. Signed-off-by: Tobias Ulmer --- Changelog | 1 + plugins/files.lua | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index b86b657..76d5000 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ NEXT: + * Fix SourceID calculation in files plugin under artificial conditions * Remove error message when an optional tool isn't present e2factory-2.3.15 diff --git a/plugins/files.lua b/plugins/files.lua index e95ef1b..f6d6a2a 100644 --- a/plugins/files.lua +++ b/plugins/files.lua @@ -268,9 +268,15 @@ function files.files_source:sourceid(sourceset --[[always ignored for files]]) hash.hash_append(hc, fileid) hash.hash_append(hc, file:location()) hash.hash_append(hc, file:server()) - hash.hash_append(hc, tostring(file:unpack())) - hash.hash_append(hc, tostring(file:patch())) - hash.hash_append(hc, tostring(file:copy())) + if file:unpack() then + hash.hash_append(hc, file:unpack()) + elseif file:patch() then + hash.hash_append(hc, file:patch()) + elseif file:copy() then + hash.hash_append(hc, file:copy()) + else + assert(false, "no file attribute set") + end -- per file licence list for licencename in file:licences():iter() do -- 2.39.5