From 4a1d67860a0a4781f788cd449398eca140e866e4 Mon Sep 17 00:00:00 2001 From: huakim Date: Mon, 16 Sep 2024 07:38:26 +0300 Subject: [PATCH] Add replace function to order to prevent from "Unknown tag" errors --- py2pack/templates/fedora.spec | 8 ++++---- py2pack/templates/mageia.spec | 8 ++++---- py2pack/templates/opensuse-legacy.spec | 8 ++++---- py2pack/templates/opensuse.spec | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/py2pack/templates/fedora.spec b/py2pack/templates/fedora.spec index 611cbe8..ee22510 100644 --- a/py2pack/templates/fedora.spec +++ b/py2pack/templates/fedora.spec @@ -3,13 +3,13 @@ Name: python-%{pypi_name} Version: {{ version }} Release: %autorelease -Summary: {{ summary }} +Summary: {{ summary|replace('\n','') }} # Check if the automatically generated License and its spelling is correct for Fedora # https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ -License: {{ license }} -URL: {{ home_page }} -Source: {{ source_url|replace(version, '%{version}') }} +License: {{ license|replace('\n','') }} +URL: {{ home_page|replace('\n','') }} +Source: {{ source_url|replace(version, '%{version}')|replace('\n','') }} BuildRequires: pyproject-rpm-macros BuildRequires: python-devel diff --git a/py2pack/templates/mageia.spec b/py2pack/templates/mageia.spec index 5c2140d..ecd1450 100644 --- a/py2pack/templates/mageia.spec +++ b/py2pack/templates/mageia.spec @@ -3,11 +3,11 @@ Name: python-%{mod_name} Version: {{ version }} Release: %mkrel 1 -Url: {{ home_page }} -Summary: {{ summary }} -License: {{ license }} +Url: {{ home_page|replace('\n','') }} +Summary: {{ summary|replace('\n','') }} +License: {{ license|replace('\n','') }} Group: Development/Python -Source: {{ source_url|replace(version, '%{version}') }} +Source: {{ source_url|replace(version, '%{version}')|replace('\n','') }} BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRequires: python-devel {%- for req in requires %} diff --git a/py2pack/templates/opensuse-legacy.spec b/py2pack/templates/opensuse-legacy.spec index 349e50d..7d9c7f9 100644 --- a/py2pack/templates/opensuse-legacy.spec +++ b/py2pack/templates/opensuse-legacy.spec @@ -18,10 +18,10 @@ Name: python-{{ name }} Version: {{ version }} Release: 0 -Summary: {{ summary_no_ending_dot|default(summary, true) }} -License: {{ license }} -URL: {{ home_page }} -Source: {{ source_url|replace(version, '%{version}') }} +Summary: {{ summary_no_ending_dot|default(summary, true)|replace('\n','') }} +License: {{ license|replace('\n','') }} +URL: {{ home_page|replace('\n','') }} +Source: {{ source_url|replace(version, '%{version}')|replace('\n','') }} BuildRequires: python-setuptools {%- if install_requires and install_requires is not none %} {%- for req in install_requires|sort %} diff --git a/py2pack/templates/opensuse.spec b/py2pack/templates/opensuse.spec index 0d7286a..b5e3a38 100644 --- a/py2pack/templates/opensuse.spec +++ b/py2pack/templates/opensuse.spec @@ -19,10 +19,10 @@ Name: python-{{ name }} Version: {{ version }} Release: 0 -Summary: {{ summary_no_ending_dot|default(summary, true) }} -License: {{ license }} -URL: {{ home_page }} -Source: {{ source_url|replace(version, '%{version}') }} +Summary: {{ summary_no_ending_dot|default(summary, true)|replace('\n','') }} +License: {{ license|replace('\n','') }} +URL: {{ home_page|replace('\n','') }} +Source: {{ source_url|replace(version, '%{version}')|replace('\n','') }} BuildRequires: python-rpm-macros {%- set build_requires_plus_pip = ((build_requires if build_requires and build_requires is not none else []) + ['pip']) %}