From: Tobias Ulmer Date: Fri, 25 Nov 2016 18:42:02 +0000 (+0100) Subject: files: fix corner-case in SourceID calculation X-Git-Tag: e2factory-2.3.16rc1~48 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=f454a3cf595e1e3525449f0d658be355f1fa6fc9;p=e2factory.git 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 --- 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