From patchwork Tue Apr 3 21:50:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Schwartz X-Patchwork-Id: 488 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id CDD312F5026A for ; Tue, 3 Apr 2018 21:50:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED=0.1, DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Tue, 3 Apr 2018 21:50:18 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 2795A9B931234; Tue, 3 Apr 2018 21:50:10 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Tue, 3 Apr 2018 21:50:10 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id E63EB2D869; Tue, 3 Apr 2018 21:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1522792209; bh=eS+mxO82nEpk09DCshVTn7VENUkeQQK7x9bhMnSg2Ks=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Reply-To; b=neGQm1NMNY5XS59WzIbyw2Yt9yK6tJv0lmwvkgrAMJ8S5LzZQFd4JwzLAqLPUEucj YnjfV0J6Nhtsz3ZFoTqFJeb8t7mxnFBXytNiteKHvGw3pe2oBnSG6aui0VlX60888F XagwZxQuv29yw8WlDjzMJwvQ5L2zqGT0d/x3CPj2oFrP9Ap10TBIIbKfLT0nFkRBo/ TkWFYbIV7HLNnY4AeynZsn1/swm3rVgoBecSz5jeY0AxVb/2u1O5asXyR1RgU7xwcD Ab8Zr94go4Z89b1nRByP+iSiHXwbi534pphKsrvcM0uMZbRcyD2+VlAqkOWvW3Z5pT ef551YL0X/TsifLf3K3iuF/3rpAeYGw+zN8jSAsMnAk+fwp7gVpIevsKI6y0Z4Klxc LJmUDdiXLE9Pd3sQ253oOTzJwxcvO6OiOOlNT1MHQOfHdomRw8jZebPWyefDoUg5bd m+550uHg5Ae2XfEnTUKcZP3yGfwH8q9qbtu3+51yrJfYfBvelwUcuNr8AE85afcE2t 3YjOQ+lfc+r3/H+804PLLvLnwg6Ffdqrr1UCxE3X+tjJe7dDHEy4TN5XE0ZacbkpGD AJYp2A/J3PGm1zANsQjbbIwJ5W48iubRuUFMa5YhpEKPCnvxgJOdLJIN+AoZtK+kIk 7UkTaxkrNXEpk59M6RFt1/zo= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 6E1612D7EA for ; Tue, 3 Apr 2018 21:50:08 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Tue, 3 Apr 2018 21:50:08 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 37C519B931231; Tue, 3 Apr 2018 21:49:57 +0000 (UTC) Received: from didactylos.attlocal.net (unknown [IPv6:2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id A597E9B931230; Tue, 3 Apr 2018 21:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1522792197; bh=eS+mxO82nEpk09DCshVTn7VENUkeQQK7x9bhMnSg2Ks=; h=From:To:Subject:Date; b=KVBy2/FnxVuA72UfeTMzJQ3HTUTQjGMxl7pNS4G/v506chtilRxojX+X6fjTfVUJr kXgnqElo491e1mGXuswtPFLEM8q0m9u0UNJ3Ze0ILqwBDbLHIGwDitFM0j7tFgqDZf 4s0B0jeCSanq23Vlpw4dxYXE4gWL6L8B5HHBTNe4rs+u9wWiBChqdcJBKB+Atzy3bt XNr15WBZI9h2DgpTFYxQWHEEMJ0tCyea1NnrxfoccKHM8j3c3hiW7TxWiz6uTo1vK7 ZhCdJO5z732rWVmMiJn7rwzBa8vwGliZiLue1iisWvxYdQc7RTzGIDOeWSSaqqdbKP uoCjbB4Om5gQym6/lrcUH6zKyRhoh6d4Tp8l9m3eBCBOho65wIoweBmKDu1DvbacpH l6AsPH0K0fJ9sCkWW0Wo1y8cB7jci3+X9mTKg5gilBSLH3KbFAWxVIdDxbyLV8ocMO Q4O5MSd+nY3BMP56qcalWwwbg1tY2oz+tnhmhisB4M8bV46cUqb1Lrote+2yJW1KsH SWVu1UdZ8slExb+gmtNJNFmA4EIefRUmlWJKVrBsd8+CN3k4qHUT7kdm+q4/zaTxJk jWaf0srIgoWdTSfORO/mkgYp112/dpzj+Vkq6ZgsL7P5J1Cpk0mWoMZVKLK/AT8ETx 90GoccU/c4choWkFqseJUV3E= From: Eli Schwartz To: pacman-dev@archlinux.org Date: Tue, 3 Apr 2018 17:50:29 -0400 Message-Id: <20180403215029.20409-1-eschwartz@archlinux.org> X-Mailer: git-send-email 2.17.0 Subject: [pacman-dev] [PATCH] makepkg: respect --ignorearch when verifying source or printing packagelist X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" --verifysource is often used to validate the PKGBUILD before uploading to the AUR, but currently there is no way to trivially check all sources. By default we don't check sources we won't use, because it forces downloading those sources, but in certain cases the user might need to check them regardless... --packagelist is usually used to derive the built package names for the user's machine, but in some cases, e.g. repo building, we might want to get the packagelist for all supported arches. This is primarily motivated by the desire to use this in the dbscripts testsuite (which tests for i686 and x86_64). While dbscripts could use `for a in ${ARCHES[@]}; do CARCH=$a makepkg --packagelist` it seemed easier to add this directly in makepkg once I was already changing --verifysource. This partially reverts d8591dd3418d55c5736022ef003891fc03b953e0 but ensures the use is controllable. Signed-off-by: Eli Schwartz --- doc/makepkg.8.txt | 13 ++++++++----- scripts/libmakepkg/util/pkgbuild.sh.in | 14 ++++++++++---- scripts/makepkg.sh.in | 11 ++++++++--- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index a065b795..42abceae 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -37,9 +37,10 @@ your logs and output are not localized. Options ------- *-A, \--ignorearch*:: - Ignore a missing or incomplete arch field in the build script. This is - for rebuilding packages from source when the PKGBUILD may be slightly - outdated and not updated with an `arch=('yourarch')` field. + Ignore a missing or incomplete arch field in the build script, when + building packages. This is for rebuilding packages from source when + the PKGBUILD may be slightly outdated and not updated with an `arch=('yourarch')` + field. Act on all available arches, when performing other actions. *-c, \--clean*:: Clean up leftover work files and directories after a successful build. @@ -66,7 +67,8 @@ Options if required and perform the integrity checks. No extraction or build is performed. Dependencies specified in the PKGBUILD will not be handled unless `--syncdeps` is used. Useful for performing subsequent offline - builds. + builds. When `--ignorearch` is used, verify all split arch sources instead + of just the sources for the current arch. *-f, \--force*:: makepkg will not build a package if a built package already exists in @@ -201,7 +203,8 @@ Options *\--packagelist*:: List the package filenames that would be produced without building. Listed - package filenames include PKGDEST and PKGEXT. + package filenames include PKGDEST and PKGEXT. When `--ignorearch` is used, + list filenames for all supported arches. *\--printsrcinfo*:: Generate and print the SRCINFO file to stdout. diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b/scripts/libmakepkg/util/pkgbuild.sh.in index 2db46f1f..e23208c3 100644 --- a/scripts/libmakepkg/util/pkgbuild.sh.in +++ b/scripts/libmakepkg/util/pkgbuild.sh.in @@ -182,11 +182,17 @@ print_all_package_names() { local version=$(get_full_version) local architecture pkg opts a for pkg in ${pkgname[@]}; do - architecture=$(get_pkg_arch $pkg) - printf "%s/%s-%s-%s%s\n" "$PKGDEST" "$pkg" "$version" "$architecture" "$PKGEXT" - if check_option "debug" "y" && check_option "strip" "y"; then - printf "%s/%s-%s-%s-%s%s\n" "$PKGDEST" "$pkg" "@DEBUGSUFFIX@" "$version" "$architecture" "$PKGEXT" + if (( IGNOREARCH )); then + get_pkgbuild_attribute "$pkg" 'arch' 1 architecture + else + architecture=$(get_pkg_arch $pkg) fi + for a in "${architecture[@]}"; do + printf "%s/%s-%s-%s%s\n" "$PKGDEST" "$pkg" "$version" "$a" "$PKGEXT" + if check_option "debug" "y" && check_option "strip" "y"; then + printf "%s/%s-%s-%s-%s%s\n" "$PKGDEST" "$pkg" "@DEBUGSUFFIX@" "$version" "$a" "$PKGEXT" + fi + done done } diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index bc2d0061..584c10a8 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1262,7 +1262,7 @@ while true; do --nosign) SIGNPKG='n' ;; -o|--nobuild) NOBUILD=1 ;; -p) shift; BUILDFILE=$1 ;; - --packagelist) PACKAGELIST=1 IGNOREARCH=1;; + --packagelist) PACKAGELIST=1 ;; --printsrcinfo) PRINTSRCINFO=1 IGNOREARCH=1;; -r|--rmdeps) RMDEPS=1 ;; -R|--repackage) REPKG=1 ;; @@ -1631,8 +1631,13 @@ if (( !REPKG )); then if (( NOEXTRACT && ! VERIFYSOURCE )); then warning "$(gettext "Using existing %s tree")" "\$srcdir/" else - download_sources - check_source_integrity + if (( VERIFYSOURCE && IGNOREARCH )); then + download_sources allarch + check_source_integrity all + else + download_sources + check_source_integrity + fi (( VERIFYSOURCE )) && exit $E_OK if (( CLEANBUILD )); then