From: Michael Shigorin <mike@altlinux.org>
To: devel-distro@lists.altlinux.org
Subject: [devel-distro] [PATCH 3/4] bin/archdep-filter: cosmetic cleanups
Date: Mon, 22 Nov 2021 21:45:17 +0300
Message-ID: <20211122184518.10821-4-mike@altlinux.org> (raw)
In-Reply-To: <20211122184518.10821-1-mike@altlinux.org>
"-a arch" is not requisite either; and having bunches
of empty lines in the resulting pkglists that are user
visible at least within the conventional installer's
alterator-pkg (groups selection) module wouldn't be nice.
I chose to sacrifice empty-line separators for clarity;
the really good cleanup would save *single* empty lines
between chunks of non-empty ones (not at the pkglist's
start or end); feel free to implement that as well.
---
bin/archdep-filter | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/archdep-filter b/bin/archdep-filter
index 674c2e1cc..7802e7e15 100755
--- a/bin/archdep-filter
+++ b/bin/archdep-filter
@@ -2,7 +2,7 @@
# filter stdin or file for words related to
# the specified target architecture
#
-# args: -a arch [-i file]
+# args: [-a arch] [-i file]
if [ "$1" = "-a" -a -n "$2" ]; then
a="$2"
@@ -43,7 +43,7 @@ sed -rn "s/\<([^@ ]*)\>|\<([^@ ]*)@$a\>[^ ]*\>/\1\2/pg" |
sed -rn "s/\<([^@ ]*)\>|\<[^ ]*@\!$a\>[^ ]*\> */\1/pg" |
sed -r "s/\<([^@ ]*)@\![^ ]+\>/\1/g" |
sed -r "s/\<([^@ ]*)@[^@ ]+\> *//g" |
-sed -r "s/^ +//;s/ +$//" |
+sed -r "s/^ +//;s/ +$//;/^$/d" |
if [ -n "$f" ]; then
cat > "$t" && mv "$t" "$f"
else
--
2.33.0
next prev parent reply other threads:[~2021-11-22 18:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 18:24 [devel-distro] архитектуры, java-11-openjdk и LibreOffice* Michael Shigorin
2021-11-22 18:36 ` Антон Мидюков
2021-11-22 18:50 ` Michael Shigorin
2021-11-23 10:20 ` Mikhail Efremov
2021-11-22 18:45 ` [devel-distro] [PATCH 0/4] archdep-filter и множественные архитектуры Michael Shigorin
2021-11-22 18:45 ` [devel-distro] [PATCH 1/4] bin/archdep-filter: implement multi-matching Michael Shigorin
2021-11-22 18:45 ` [devel-distro] [PATCH 2/4] bin/archdep-filter: implement multi-!matching too Michael Shigorin
2021-11-29 16:44 ` Michael Shigorin
2021-11-29 16:49 ` Антон Мидюков
2021-12-04 15:10 ` Антон Мидюков
2021-11-22 18:45 ` Michael Shigorin [this message]
2021-11-22 18:45 ` [devel-distro] [PATCH 4/4] bin/archdep-filter: a debugging note Michael Shigorin
2021-11-29 8:21 ` [devel-distro] [PATCH 0/4] archdep-filter и множественные архитектуры Антон Мидюков
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211122184518.10821-4-mike@altlinux.org \
--to=mike@altlinux.org \
--cc=devel-distro@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Distributions development
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-distro/0 devel-distro/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel-distro devel-distro/ http://lore.altlinux.org/devel-distro \
devel-distro@lists.altlinux.org devel-distro@lists.altlinux.ru devel-distro@lists.altlinux.com
public-inbox-index devel-distro
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-distro
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git