From cc626ebe8d79d5fa12efd180e53d54b53c581d35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 3 Aug 2018 10:34:32 +0100 Subject: [PATCH] rpm: simplify applying of patches MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The distros we support for RPM builds all have %autosetup support so we can ditch the convoluted code for running git manually and use the RPM defaults. Reviewed-by: Martin Kletzander Signed-off-by: Daniel P. Berrangé --- libvirt.spec.in | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f0c55554c3..3edb60d2d2 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -993,43 +993,7 @@ Libvirt plugin for NSS for translating domain names into IP addresses. %prep -%setup -q - -# Patches have to be stored in a temporary file because RPM has -# a limit on the length of the result of any macro expansion; -# if the string is longer, it's silently cropped -%{lua: - tmp = os.tmpname(); - f = io.open(tmp, "w+"); - count = 0; - for i, p in ipairs(patches) do - f:write(p.."\n"); - count = count + 1; - end; - f:close(); - print("PATCHCOUNT="..count.."\n") - print("PATCHLIST="..tmp.."\n") -} - -git init -q -git config user.name rpm-build -git config user.email rpm-build -git config gc.auto 0 -git add . -git commit -q -a --author 'rpm-build ' \ - -m '%{name}-%{version} base' - -COUNT=$(grep '\.patch$' $PATCHLIST | wc -l) -if [ $COUNT -ne $PATCHCOUNT ]; then - echo "Found $COUNT patches in $PATCHLIST, expected $PATCHCOUNT" - exit 1 -fi -if [ $COUNT -gt 0 ]; then - xargs git am <$PATCHLIST || exit 1 -fi -echo "Applied $COUNT patches" -rm -f $PATCHLIST -rm -rf .git +%autosetup -S git_am %build %if ! %{supported_platform} -- 2.47.2