From dd1c8b818bafed44c3569e1f252d74927d5a7ab6 Mon Sep 17 00:00:00 2001
From: Walter Lozano <walter.lozano@collabora.com>
Date: Tue, 8 Oct 2024 18:12:43 +0200
Subject: [PATCH] ci-license-scan: Workaround invalid copyright
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When ci-license-scan tries to fill copyright information from d/copyright
it includes \n if they are present in copyright information. If later,
there is copyright data, the \n is placed in the middle creating an invalid
copyright file.

To overcome this issue, strip \n from the copyright.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
---
 package-source-builder/overlay/usr/bin/ci-license-scan | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package-source-builder/overlay/usr/bin/ci-license-scan b/package-source-builder/overlay/usr/bin/ci-license-scan
index bed848f..5c7ec2e 100755
--- a/package-source-builder/overlay/usr/bin/ci-license-scan
+++ b/package-source-builder/overlay/usr/bin/ci-license-scan
@@ -289,7 +289,7 @@ def configure_scanner():
             if debian_license and 'debian/' not in copyright_overrides:
                 copyright_overrides['debian/'] = {
                     'license': debian_license.synopsis,
-                    'copyright': debian_copyright
+                    'copyright': debian_copyright.strip()
                 }
         except:
             pass
-- 
GitLab