From nobody Sun May 5 04:15:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1533288943868482.02618855702667; Fri, 3 Aug 2018 02:35:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 691B930820CD; Fri, 3 Aug 2018 09:35:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F370309128B; Fri, 3 Aug 2018 09:35:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5536E18052E9; Fri, 3 Aug 2018 09:35:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w739ZZbj022884 for ; Fri, 3 Aug 2018 05:35:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id B9AEF2026D66; Fri, 3 Aug 2018 09:35:35 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-135.ams2.redhat.com [10.36.117.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AEC32026D65; Fri, 3 Aug 2018 09:35:34 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 3 Aug 2018 10:35:32 +0100 Message-Id: <20180803093532.16922-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] rpm: simplify applying of patches X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 03 Aug 2018 09:35:42 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- libvirt.spec.in | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 19ae55cdaf..a2f3112a0b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -993,43 +993,7 @@ Libvirt plugin for NSS for translating domain names in= to IP addresses. =20 %prep =20 -%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 =3D os.tmpname(); - f =3D io.open(tmp, "w+"); - count =3D 0; - for i, p in ipairs(patches) do - f:write(p.."\n"); - count =3D count + 1; - end; - f:close(); - print("PATCHCOUNT=3D"..count.."\n") - print("PATCHLIST=3D"..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=3D$(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 =20 %build %if ! %{supported_platform} --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list