From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Michael Shigorin To: devel-distro@lists.altlinux.org Date: Mon, 22 Nov 2021 21:45:15 +0300 Message-Id: <20211122184518.10821-2-mike@altlinux.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20211122184518.10821-1-mike@altlinux.org> References: <20211122182425.GH24863@imap.altlinux.org> <20211122184518.10821-1-mike@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [devel-distro] [PATCH 1/4] bin/archdep-filter: implement multi-matching X-BeenThere: devel-distro@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Distributions development List-Id: Distributions development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2021 18:45:33 -0000 Archived-At: List-Archive: This has been inspired by a few commits that cared for package availability reasons on a particular architecture; the problem at hand is that pkglists might need to include groups of packages that are (un)available on groups of arches, and tackling that with plain pkg@arch just results in combinatorial explosion of that matrix. Arches are handled one-by-one with a few hardcoded macro substitutions. Exploding a "pkg@arch1,arch2" string into a set of: pkg@arch1 pkg@arch2 with subsequent archdep pruning would do the trick; so here's another sed oneliner that does just that: $ echo 'pkg@X86,ARM,ppc64le' | sed -r ':loop; s/^((([^@]+@)[^,]+)+),([^,]+)/\1\n\3\4/; t loop' pkg@X86 pkg@ARM pkg@ppc64le See-also: 9601a9e7ce92c7a521fd154f59d8e17524f12a95 See-also: 5581dc91ec6f3330c338995d1cdfbca285298011 See-also: http://stackoverflow.com/a/55781741/561921 --- bin/archdep-filter | 1 + doc/archdep.txt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/bin/archdep-filter b/bin/archdep-filter index 69ff9c0a4..58cd076e9 100755 --- a/bin/archdep-filter +++ b/bin/archdep-filter @@ -34,6 +34,7 @@ esac # NB: pipe runs in parallel => faster than -e -e cat ${f:+"$f"} | +sed -r ':loop; s/^((([^@]+@)[^,]+)+),([a-zA-Z0-9_]+)/\1\n\3\4/; t loop' | sed -rn "s/\<([^@ ]*)\>|\<([^@ ]*)@$A\>/\1\2/pg" | sed -rn "s/\<([^@ ]*)\>|\<[^@ ]*@\!$A\> */\1/pg" | sed -r "s/\<([^@ ]*)@IA32\>/\1@i586 i586-\1@x86_64/g" | diff --git a/doc/archdep.txt b/doc/archdep.txt index 4a33233ef..d1a1c3e91 100644 --- a/doc/archdep.txt +++ b/doc/archdep.txt @@ -48,6 +48,11 @@ ARM (armh или aarch64), а также выборка "для любой архитектуры, кроме" (например, @!E2K, или "@!ARM). +С версии 1.4.21 поддерживается перечисление архитектур через запятую +после "@": + + LibreOffice-still@X86,aarch64,ppc64le,mipsel + Для преобразования можно воспользоваться следующей командой: sed -r -e 's/@I586_ONLY@([^\t ]+)/\1@i586/g' \ -- 2.33.0