Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1n3s9l-0007hk-Vn for mharc-grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3s9l-0007gs-7l for grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:41 -0500 Received: from [2607:f8b0:4864:20::730] (port=35456 helo=mail-qk1-x730.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3s9j-00020o-Kc for grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:40 -0500 Received: by mail-qk1-x730.google.com with SMTP id 131so28297967qkk.2 for ; Sat, 01 Jan 2022 20:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aMQcbSLzLBmrwuyZs6S2O7MHq07TvJwO699r9IQPIh4=; b=lidqtZQFKaZSqRO2yxSGHoqknGu/HVl8fpRman/Ivv75JZfu334hjvtphDEL/Qhthq atRsnt9l1+g4ct07zjTwTYPoPvHyXFUpq9i/yVEpH2pwFCBjAxv+2wDWmqMCLOr/HNkC 2J/v8LLzHxItTnyBbdX4BR+5RIk4puH2YM0KgWCiKH/Tg7bMNFPJa5Howh8/Jnocanzn PMMMLC4GDBBpjPa7gwGbBBkBOibpmgguVYL3K2imkH7GBIN7cJQOUlaS86sgbGcbHxNL hr0jGgvyPvckYhlNiTxZ+9H2T/0KO5rMQe9YEpWSdQY/SfQa6LL4qw9+CbG7egpfmCAS BvnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aMQcbSLzLBmrwuyZs6S2O7MHq07TvJwO699r9IQPIh4=; b=DUGSomN6g+qyqppCbW4CSMWdD9KsNR/jaO9FQP+b+xKe51E67SEyGq3M0k2eYjspkJ 7EiZpvQvq65Vha3rOKjU7qb3JPC/7kz5lxXQTzJqHZBbS6awpzayzdfnojehfgaSvJIY mZ2Oi9VKXvjI1JGDoeatBS5NMJ7logD9cc9fZriBkVujwnltFTtFaqQ3CUYfh7MUKWuh PEN2VByDiBQq8i84xAB/2c3hHaM6v9mJNiZc+AimiRZ9PJg41w0GHAjpxAwiaXRBl0qN yz5KwR/i+oYc6vbCRrGjrQsoj5cIDF0xMARZZiXix8wd86idwFTRJy6V8BVMbCA9hN+d RXVg== X-Gm-Message-State: AOAM5336AiyAV0rl8SWtA2zcvX8I45lbB1+kuz/wc55cNuOs9NcuzWu3 Z2JJ521QKI1ZNLGoRcHW27IfXNdg0pci5w== X-Google-Smtp-Source: ABdhPJzCMbJgSI6f0xka7uQCgkY3y/wqRloCN0oc7DFUcBX5G5QwWMDpQ56kEcwDE/6tleRVPNKj0w== X-Received: by 2002:a05:620a:130c:: with SMTP id o12mr28928293qkj.490.1641096458622; Sat, 01 Jan 2022 20:07:38 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id 137sm22660725qkm.69.2022.01.01.20.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jan 2022 20:07:38 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v2 01/12] grub-shell: Allow specifying non-default trim line contents Date: Sat, 1 Jan 2022 22:07:11 -0600 Message-Id: <52df3299f9e35f7cf2bfa65c61e8378b406b2962.1641095841.git.development@efficientek.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::730 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::730; envelope-from=development@efficientek.com; helo=mail-qk1-x730.google.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2022 04:07:41 -0000 This will be useful for tests that have unwanted output from setup. This is not documented because its only intended to be internal at the moment. Also, --no-trim is allowed to explicitly turn off trim. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 93e9f5148..b409962f1 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -32,6 +32,7 @@ PATH="${builddir}:$PATH" export PATH trim=0 +trim_head=664cbea8-132f-4770-8aa4-1696d59ac35c # Usage: usage # Print the usage. @@ -212,8 +213,13 @@ for option in "$@"; do echo "$0 (GNU GRUB ${PACKAGE_VERSION})" exit 0 ;; --trim) - trim=1 + trim=1 ;; + --trim=*) + trim=2 + trim_head=`echo "$option" | sed -e 's/--trim=//' -e 's/,/ /g'` ;; + --no-trim) + trim=0 ;; --debug) debug=1 ;; --modules=*) @@ -336,8 +342,6 @@ terminal_input ${term} terminal_output ${term} EOF -trim_head=664cbea8-132f-4770-8aa4-1696d59ac35c - if [ $trim = 1 ]; then echo "echo $trim_head" >>${cfgfile} fi @@ -452,8 +456,8 @@ fi do_trim () { - if [ $trim = 1 ]; then - awk '{ if (have_head == 1) print $0; } /664cbea8-132f-4770-8aa4-1696d59ac35c/ { have_head=1; }' + if [ $trim = 1 ] || [ $trim = 2 ]; then + awk '{ if (have_head == 1) print $0; } /'"$trim_head"'/ { have_head=1; }' else cat fi -- 2.27.0