From patchwork Fri Jun 28 20:12:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: morganamilo X-Patchwork-Id: 1161 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 2115A1065C27E for ; Fri, 28 Jun 2019 20:15:09 +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.0.10] [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 28 Jun 2019 20:15:09 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id EDA3413966ECE3; Fri, 28 Jun 2019 20:15:06 +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; Fri, 28 Jun 2019 20:15:06 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id E46FA2C31D; Fri, 28 Jun 2019 20:15:06 +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=HwgYn/37 Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id E0C242C319 for ; Fri, 28 Jun 2019 20:15:02 +0000 (UTC) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 28 Jun 2019 20:15:02 +0000 (UTC) Received: by mail-wm1-x32c.google.com with SMTP id w9so10044774wmd.1 for ; Fri, 28 Jun 2019 13:15:02 -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=IYZYcZWyRHFffGD13OjHsJfMIgr0nLLAiFdC5OMJ4e8=; b=HwgYn/37b1d1zhohX39Nbaw7nQ3ITKzs4jYrXXI0AmGE5XhBierUZMfSmhpHkHyS03 vXMyE+jg/SizPGufZ/skDzoujEL18vPyfMAmODZillNXaASveeno512fbmVwRF4hxXyu wsr9ZW2aL7YzAWJJ6tM0fTdS247BbvScHfunM4/bXsJ/aLW80f7w2j6zLxnlr/M19IYk JrrQw/8E43nNzSu9tqRxfaWWSe/IYn+6gfADlMYtEu1+uhfRIhCEKz9xtybsnuulr5tb RAU45yUkAj6iOAWZgYL0wg4qgTP35xXfwx/R1l2tXSr7b4JM/HAbauHXdxrAy7D4CGBM xWYg== 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=IYZYcZWyRHFffGD13OjHsJfMIgr0nLLAiFdC5OMJ4e8=; b=rUMUCHPutggLv6QDHPRxPZpNPfPJsVHcGfC38PX1B6UOGGk9g98GLrkhXnmAS5E6Iw Ef78FUBVpNV6TMpYKkMGdp2Ycd6UUxyw9LrXlq1nyDvhzNLrLVSQ9WW1o6tw7MAaRUds N6ZiLA9s9NBj3cB191ktfLUan+Y3CxX4DN9iwrIP8ZfkUF6tx8GzVllmPdg44WSRG6nK VVyeYv2MNaXVlcuPl0AxbBfup8eH9m2aRginQc6sKQlinqOulKDz5uKvrmEgtAv7L60F FGmUfn2lkIeadh3mYf3pRybpqjwQsux0ryvjj+aThNPMi+0+rs6OCb54lKQX+oU5y7x/ 3FEw== X-Gm-Message-State: APjAAAW31FBPyfP0ED6nz+GHVukMLHKCy1pNehgaEPgmi+kjieYy5Y85 p40/gw8+P0NEVLC45KZr0Gc69Csp X-Google-Smtp-Source: APXvYqwgHKFm6QFUlrs1ndtqUb7An7t5ZCholFcWt0NyeB5tTI+67gLXewvx2aBwwE9N8XavNUej1A== X-Received: by 2002:a1c:c545:: with SMTP id v66mr6041606wmf.51.1561752901001; Fri, 28 Jun 2019 13:15:01 -0700 (PDT) Received: from localhost.localdomain (host-92-21-177-57.as13285.net. [92.21.177.57]) by smtp.gmail.com with ESMTPSA id x20sm3175787wmc.1.2019.06.28.13.15.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 13:15:00 -0700 (PDT) From: morganamilo To: pacman-contrib@lists.archlinux.org Subject: [PATCH 1/2] checkupdates: add -q/--quiet Date: Fri, 28 Jun 2019 21:12:57 +0100 Message-Id: <20190628201258.20566-1-morganamilo@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" diff --git a/src/checkupdates.sh.in b/src/checkupdates.sh.in index 0885983..024243c 100644 --- a/src/checkupdates.sh.in +++ b/src/checkupdates.sh.in @@ -22,6 +22,7 @@ declare -r myname='checkupdates' declare -r myver='@PACKAGE_VERSION@' DOWNLOAD_CACHE=0 +QUIET=0 m4_include(../lib/output_format.sh) m4_include(../lib/term_colors.sh) @@ -38,14 +39,15 @@ Usage: ${myname} [options] Options: -d, --download download pending updates to the pacman cache. -h, --help display this help message and exit. + -q, --quiet only display pkgnames. Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database. __EOF__ } -OPT_SHORT='dh' -OPT_LONG=('download' 'help') +OPT_SHORT='dhq' +OPT_LONG=('download' 'help' 'quiet') if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then exit 1 @@ -60,6 +62,8 @@ while :; do -h|--help) usage exit 0 ;; + -q|--quiet) + QUIET=1 ;; --) shift break ;; @@ -92,6 +96,9 @@ fi mapfile -t updates < <(pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]') if (( ${#updates[@]} )); then + if (( $QUIET )); then + updates=("${updates[@]%% *}") + fi printf '%s\n' "${updates[@]}" if (( DOWNLOAD_CACHE )); then sudo pacman -Sw --noconfirm "${updates[@]%% *}" --dbpath "$CHECKUPDATES_DB" --logfile /dev/null From patchwork Fri Jun 28 20:12:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: morganamilo X-Patchwork-Id: 1162 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 BDC001065C286 for ; Fri, 28 Jun 2019 20:15:09 +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.10] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 28 Jun 2019 20:15:09 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 4E60B13966ECE4; Fri, 28 Jun 2019 20:15:07 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (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; Fri, 28 Jun 2019 20:15:07 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id EE1A22C33A; Fri, 28 Jun 2019 20:15:06 +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=fzqq7eHl Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id E34902C31D for ; Fri, 28 Jun 2019 20:15:02 +0000 (UTC) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 28 Jun 2019 20:15:02 +0000 (UTC) Received: by mail-wm1-x336.google.com with SMTP id c6so10092792wml.0 for ; Fri, 28 Jun 2019 13:15:02 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=xCXGrATge978tsps7HkXawLEdtI6Bx92VKTuSuN5Hww=; b=fzqq7eHlZ1szLj+BxYcd/4PfuvX0XKsju7JnvIdw6s8oQFzVoCOCqAOGqGxPJ5OdL4 sHTZJJoxd7j5ycaSMZ4wr7XMe7wBfKBb5YTk8NxPxcEvhNsnnNeQesaCtWY25mvU69Nq bxeUrMS3abMWa+gmCXBq3rC5Y0R2gZAIT3sdu+kiwnvpOpZTN9LaWkgWjd8hdfMln/oZ Toqt2wBWskAyNBYKew1dmjGzftK1lJBzry084+u1FGfJ6dyC7ZU6MiT3MyzYFqHxM4nk nxy7agJcgG2NqjpoKOD+LIg84M+sVpjoI6XmrxcLbFG8CssHB7X8fU3wqjyzUsf6WYlh udmw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xCXGrATge978tsps7HkXawLEdtI6Bx92VKTuSuN5Hww=; b=QTVq85n7Ld6Ve64sqTYJuFf6tX+xMdbo2Eb6hapKUH7QoYc1dPk7qc/l+loweM/GD6 QmFIhAbIzxJ4vjIq1fOVfgUP6jxeukRhd/CSP75d7D4TdxHFEMRAc+yycWGv1hocDd66 k2+fo5LWAacDK9K9TXS5do/KdeMa3sZjPfwHmwTje+WynbKA3HNjaxEmP5TxMomxPjQY TTTAMLsY/w7n8B+RUSXjSovvJpGkSMS9vkfGWq76XPH9gqZvHK7FmB1GAIJIt7MX6orQ XTWhAutmCmfLsKvcFf8bFBKX/5EOCDVwBTGZgVRneXclQzZAtcuDjh8KvqC94p7U/EfC RYHA== X-Gm-Message-State: APjAAAWioHSWGUaqddDj8hiHVN0R4LhgzsOgYznzDZQ7nM8h/LFJWZm+ BRfqJAZ0fpRyWzpWZr1FtvycGLlT X-Google-Smtp-Source: APXvYqw/4BWZ9mFkrPFVZ4NBT59EyQSYsyX1nF3zG0DK3s2hF5Y0vm0r37caBqIdzpSAIeEGSa+Z8A== X-Received: by 2002:a1c:a952:: with SMTP id s79mr5589946wme.28.1561752901690; Fri, 28 Jun 2019 13:15:01 -0700 (PDT) Received: from localhost.localdomain (host-92-21-177-57.as13285.net. [92.21.177.57]) by smtp.gmail.com with ESMTPSA id x20sm3175787wmc.1.2019.06.28.13.15.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 13:15:01 -0700 (PDT) From: morganamilo To: pacman-contrib@lists.archlinux.org Subject: [PATCH 2/2] checkupdates: allow filtering the update list Date: Fri, 28 Jun 2019 21:12:58 +0100 Message-Id: <20190628201258.20566-2-morganamilo@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190628201258.20566-1-morganamilo@gmail.com> References: <20190628201258.20566-1-morganamilo@gmail.com> 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" diff --git a/src/checkupdates.sh.in b/src/checkupdates.sh.in index 024243c..ae8197c 100644 --- a/src/checkupdates.sh.in +++ b/src/checkupdates.sh.in @@ -34,7 +34,7 @@ ${myname} v${myver} Safely print a list of pending updates -Usage: ${myname} [options] +Usage: ${myname} [options] [targets...] Options: -d, --download download pending updates to the pacman cache. @@ -93,7 +93,7 @@ if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> / error 'Cannot fetch updates' exit 1 fi -mapfile -t updates < <(pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]') +mapfile -t updates < <(pacman -Qu --dbpath "$CHECKUPDATES_DB" -- "$@" 2> /dev/null | grep -v '\[.*\]') if (( ${#updates[@]} )); then if (( $QUIET )); then