]> git.e2factory.org Git - e2factory.git/commitdiff
LicenceID includes the licence name
authorTobias Ulmer <tu@emlix.com>
Thu, 6 Feb 2014 11:13:40 +0000 (12:13 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Makes no sense to hash it twice. Fixes bz#124

Signed-off-by: Tobias Ulmer <tu@emlix.com>
plugins/collect_project.lua
plugins/files.lua
plugins/git.lua

index a98c0962884a9a162ec09ea73772fc6705a78f03..3ab8f5e1c55e49f7cafb5e0ddcfaabe409b7e6cc 100644 (file)
@@ -156,9 +156,6 @@ local function collect_project_resultid(info, resultname)
         if not rc then return nil, re end
     end
     for _,l in ipairs(licence.licences_sorted) do
-        rc, re = hash.hash_line(hc, l:get_name())
-        if not rc then return nil, re end
-
         -- We collect all licences. So we cannot be sure to catch
         -- them via results/sources. Include them explicitly here.
         local lid, re = l:licenceid(info)
index c214adc7ac10425ae99eeb2cfbe75d173cb250a6..41a748edb2ab8ce5969632b8d2c5f7c143c23438 100644 (file)
@@ -495,14 +495,12 @@ function files.sourceid(info, sourcename, sourceset)
     hash.hash_line(hc, src.name)
     hash.hash_line(hc, src.type)
     hash.hash_line(hc, src._env:id())
-    for _,l in ipairs(src.licences) do
-        local alicence = licence.licences[l]
-        hash.hash_line(hc, l)
-        local licenceid, re = alicence:licenceid(info)
-        if not licenceid then
+    for _,ln in ipairs(src.licences) do
+        local lid, re = licence.licences[ln]:licenceid(info)
+        if not lid then
             return false, re
         end
-        hash.hash_line(hc, licenceid)
+        hash.hash_line(hc, lid)
     end
     for _,f in ipairs(src.file) do
         local fileid, re = e2tool.fileid(info, f)
index 6382373c1745bd427fa166d40150943c1a7bca09..7fb5c45aff6d839d064153a8474bbe6973f661a6 100644 (file)
@@ -536,13 +536,12 @@ function git.sourceid(info, sourcename, sourceset)
     hash.hash_line(hc, src.name)
     hash.hash_line(hc, src.type)
     hash.hash_line(hc, src._env:id())
-    for _,l in ipairs(src.licences) do
-        hash.hash_line(hc, l) -- XXX: redundant
-        local licenceid, re = licence.licences[l]:licenceid(info)
-        if not licenceid then
+    for _,ln in ipairs(src.licences) do
+        local lid, re = licence.licences[ln]:licenceid(info)
+        if not lid then
             return false, re
         end
-        hash.hash_line(hc, licenceid)
+        hash.hash_line(hc, lid)
     end
     -- git specific
     --hash.hash_line(hc, src.branch)