From patchwork Sun Jul 28 10:34:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Rustand X-Patchwork-Id: 1180 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 1CF8A11206F86 for ; Sun, 28 Jul 2019 10:34:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=1,DKIM_SIGNED=0.1,FREEMAIL_FROM=0.5,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001,T_DMARC_POLICY_NONE=0.01, T_DMARC_SIMPLE_DKIM=0.01 autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] [127.0.0.11] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Sun, 28 Jul 2019 10:34:49 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 61EA6140940AED; Sun, 28 Jul 2019 10:34:42 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Sun, 28 Jul 2019 10:34:42 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 4F4972A543; Sun, 28 Jul 2019 10:34:42 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Tw/dnIvo Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 2123D2A542 for ; Sun, 28 Jul 2019 10:34:37 +0000 (UTC) Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by luna.archlinux.org (Postfix) with ESMTPS for ; Sun, 28 Jul 2019 10:34:37 +0000 (UTC) Received: by mail-lf1-x130.google.com with SMTP id z15so35718054lfh.13 for ; Sun, 28 Jul 2019 03:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kIv5/s6lFHKgJEQ8R5DnZNvNzM5bA3dWi6mOJ95v37o=; b=Tw/dnIvo6y9Sh8jiawKPyfDqEohSEC0pYZzkSyU1qKpRIVX+EzXR/uyTBdIQ+1voQ1 WH4Cm/gGNAjUjgXMnGL9WrGObVgTjMfj/gw2TTZ66VsSDp/FQ8JxS434U+MDEF+KYuqX 7MmhHHe/OSjjwLBaW47IBewLVHWqKfh1bUJCB29xspkiW0Jo6xexzR4d63Uah+UweBQn ODGDaS9wgZZkx1BjDJlLp9piUxSD3YIJTv1iAjXZuvCGQ8aLrToMLUxr7/2BF7WRCXIt 4wXXpzDbqkFu54xGPZAS1Z6KIjEt9Cld9bexBc5tb7siOvzqEVRBmiR3cHvpUyrtGGLC GNXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kIv5/s6lFHKgJEQ8R5DnZNvNzM5bA3dWi6mOJ95v37o=; b=O3e6LRQ/Nd5fYAd1TgR+vrCdVNUV5tqs03ich4f7CtCEgeVghgqsMf1y2PZBMThIRh yj2dsls2j63Cez7fyRIhP6rw7f26cAiXNGAOVkpqU8AHPgTECrCVKHHtqJz+yJbpyEb1 ub6aTzSAyWvB5TyPnJt7r/DZT7e3XAvQOWXjSApCj+wm5tc9hCKx3saxRb1M9dq1VkWu BEcK6CqeOBnUdQa/deH+vHGD4RdFWBiKR0AGc9jEhcKrhrDGKFjeCpjIPK3ysA16RKI9 n3PKBi4AeLGBp345+R2bxUjm06L3QmhuefF8NMcgZDg/vTXBARlpiKsUApWMaTTz1Ebb xCEQ== X-Gm-Message-State: APjAAAWcAqrvSQdCvt11aHVkjclC0wWXXqHVet5+U2bdzBnaaOOilEvp noxUIiwfYVAF+dRvUmypPd0lIu/l X-Google-Smtp-Source: APXvYqwzGCu2Klu0gKvYzcaUTcawttdzgJ98ISiJxmxMQa4b5vqhLIrm0P0e96S1mjjpQx8bEFyY0Q== X-Received: by 2002:ac2:5601:: with SMTP id v1mr8099311lfd.106.1564310075008; Sun, 28 Jul 2019 03:34:35 -0700 (PDT) Received: from localhost.localdomain (57-112-11.connect.netcom.no. [176.11.112.57]) by smtp.googlemail.com with ESMTPSA id l11sm10111354lfk.1.2019.07.28.03.34.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 28 Jul 2019 03:34:34 -0700 (PDT) From: Lars Rustand To: pacman-contrib@lists.archlinux.org Subject: [PATCH] paclist: Allow listing packages from multiple repos at once Date: Sun, 28 Jul 2019 12:34:42 +0200 Message-Id: <20190728103442.18603-1-rustand.lars@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-BeenThere: pacman-contrib@lists.archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for pacman-contrib development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: pacman-contrib-bounces@lists.archlinux.org Sender: "pacman-contrib" Signed-off-by: Lars Rustand --- src/paclist.sh.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/paclist.sh.in b/src/paclist.sh.in index efd47af..4fd7e5e 100644 --- a/src/paclist.sh.in +++ b/src/paclist.sh.in @@ -25,7 +25,7 @@ usage() { echo printf "List all packages installed from a given repository\n" "${myname}" echo - printf "Usage: %s \n" "${myname}" + printf "Usage: %s ...\n" "${myname}" echo printf "Example: %s testing\n" "${myname}" } @@ -49,8 +49,10 @@ elif [[ $1 = -@(V|-version) ]]; then exit 0 fi -pacman -Sl $1 | awk '/\[.*[[:alpha:]]+]$/ {print $2,$3}; - /\[.*[[:digit:]]+]$/ {print $2,substr($NF, 1, length($NF) - 1)}' +for repo in "$@"; do + pacman -Sl $repo | awk '/\[.*[[:alpha:]]+]$/ {print $2,$3}; + /\[.*[[:digit:]]+]$/ {print $2,substr($NF, 1, length($NF) - 1)}' +done # exit with pacman's return value, not awk's exit ${PIPESTATUS[0]}