From patchwork Tue Nov 10 13:45:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397652 X-Patchwork-Delegate: yszhou4tech@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=rLNEQdJx; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=IQqt2M9c; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CVq1r5slFz9sRK for ; Wed, 11 Nov 2020 00:48:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xOD1M19AMnpAWz3E6vNoOgirgJh9mhVtrfmoyfF/KRM=; b=rLNEQdJxSmwlYqeURJkwl6ZWF cEqITahNvsrzPcOmCk0QpJoRD751R058TdhzW5kqzDdjPEnskUHtaME2GtQpLyXJEq9SECF7A8Nqf 0mqC3p+ydmmoGob51F0Y5gIpJo+6LAHaN8UB3aE4STqGdYOYLzhjBLZpzIgnVS0b/7B1iT/EoeqiN IqFsB90KoPeWV4fHsm7K1nu2E5DKgzuLX1dg7IVfhmS+gRlpFSbVfmD1B7NE7XliIpY6ezNfWwlAL SUofHG4P6bvjSheAZw43pKchfmyUrBswCzQheKdGzLp4Q5UpDLrZNIAVmyTJ6bbObd5fGL8krBGVA 4EjAVp/OA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyg-000265-Ca; Tue, 10 Nov 2020 13:46:30 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyX-00022o-Ld for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:22 +0000 Received: by mail-pf1-x432.google.com with SMTP id q5so8498338pfk.6 for ; Tue, 10 Nov 2020 05:46:20 -0800 (PST) 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=ayzVFYEIqQcDgOObb/GGaRFsTfwoTlnw/ElU5+BN88o=; b=IQqt2M9cLV1UO0PX45vXQNAujJl9RmbPw+iHDYrAriFnddsDsZkRcFb59VAQ438UC3 3/KVDnAbfSC+0YnVoARmgaADQyN/C58oS+1BG3m2L6DeqX4+IzNdyZZFta6swQELEmxn URDE1qYerL4CVAGtjrk8AIzNn+ftBK2tjh+lMtMgfQpet0OWMCqoTTz/ofZUGQz31DpL W9xg7e3qdBuQF6ETB8CRjDtaV93ZnlrMOkLKKZ4Xd1lagJAaMm/E77OOmHCKx8ipYzol jXJFq4JBApR/mGqe0o3bOMa2TFodOjqoJnqIER0VB8PDy6zjDSaH3ltjFKJmDvIE82s6 2IwA== 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=ayzVFYEIqQcDgOObb/GGaRFsTfwoTlnw/ElU5+BN88o=; b=chjXjhOqRfDY6rFcba3AMlnU+7HRQbTTbw76LkMVsu0G7/jrHvjkYa7x3U5MgBYn5D IXNfRUo7dwhwml66AM2Q+FL6zCoMVUbOWb9Exmt+rBxAFnnUfZBXFUXvtWz9zu5wyfBu +Mpaw1p6REKtzRroMcCkQIp0KC+AIC6FUjUoeGsL33mpM+EWUmAi/9yg1Ld2iPRHK+E4 zsI+bb5iNauyfdZVd0zk6UyD/zSkCpAbpHEW3384Eo4N1rGpjE3PKsLygxZEO5ybncCN I6Y3URMnk45nhVqbluJHSb58VeLmdwmU3nyV5UZeJR1yYbgIGTwPf857ZDlmr9dd6PR0 D/Xw== X-Gm-Message-State: AOAM530qvmm43YQevFB+8gqrdYB3SKW6XedYXIxK1VTea92qZQ3rGak0 ZUE5+akrJxldoI25yyvofoZuxquSRoA= X-Google-Smtp-Source: ABdhPJy6I51hIOk+CUOHUOVSkbrSIzYOeIumJQd7a8qQZZK76kPpsMcku43d8RIHlzAE8K9L9GV4dw== X-Received: by 2002:aa7:9095:0:b029:164:75c4:5d15 with SMTP id i21-20020aa790950000b029016475c45d15mr18344846pfa.49.1605015979493; Tue, 10 Nov 2020 05:46:19 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:18 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 02/11] base-files: upgrade: add vn and variants Date: Tue, 10 Nov 2020 21:45:49 +0800 Message-Id: <20201110134558.7905-3-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084621_767280_43164D95 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:432 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org To be used with in the following pattern vn "Remaining: " for p in $xx; do _vn "$p" done _v Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/common.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 2ae83f5bfb..0f25199365 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -63,8 +63,20 @@ ask_bool() { [ "$answer" -gt 0 ] } +_v() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2 +} + +_vn() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2 +} + v() { - [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2 + _v "$(date) upgrade: $@" +} + +vn() { + _vn "$(date) upgrade: $@" } json_string() {