From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 28 Apr 2021 16:52:28 +0300 From: Michael Shigorin To: devel-distro@lists.altlinux.org Message-ID: <20210428135228.GA20076@imap.altlinux.org> References: <20210428123853.GA16601@imap.altlinux.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210428123853.GA16601@imap.altlinux.org> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [devel-distro] [PATCH] reports.mk: Generate rpm and srpms lists 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: Wed, 28 Apr 2021 13:52:28 -0000 Archived-At: List-Archive: --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Apr 28, 2021 at 03:38:53PM +0300, Michael Shigorin wrote: > PS: ещё немножко посмотрел этот скрипт -- не настаиваю на мерже > последнего патча из приложенных трёх, но > >From 20642ae4aa3847403d3462e74ace4c00ca3240b3 Mon Sep 17 00:00:00 2001 > From: Michael Shigorin > Date: Wed, 28 Apr 2021 15:06:57 +0300 > Subject: [PATCH 3/3] reports.mk: use process substitution to dedup > > The first half of both pipes was clearly a copy-pasted > initial logfile processing; the file can be of considerable > size (e.g. several megabytes) so it might be slightly more > efficient and cool (but a bit more arcane) to use bash(1)'s Сам же написал -- bash; а SHELL по умолчанию будет sh. > process substitution along with good ol' tee(1) like this: > > --- a/reports.mk > +++ b/reports.mk > > reports/packages: reports/prep > - @grep -E 'chroot/.in/[^/]*.rpm' < $(BUILDLOG) | \ > - cut -d' ' -f 1 | tr -d "'"'`' | sed 's,^.*/,,' | \ > - sort -u > "$(REPORTDIR)/list-rpms.txt" > @grep -E 'chroot/.in/[^/]*.rpm' < $(BUILDLOG) | \ > cut -d' ' -f 1 | tr -d "'"'`' | \ > + tee /dev/stderr 2> >(sed 's,^.*/,,' | \ > + sort -u > "$(REPORTDIR)/list-rpms.txt") | \ > xargs rpm -qp --queryformat '%{sourcerpm}\n' | \ > sort -u > "$(REPORTDIR)/list-srpms.txt" По идее, на стадии report.mk нам уже нет дела до трассировки, которая взводится в lib/report.mk накруткой на SHELL; понадобится ещё вот такая строчка сперва: reports/packages: SHELL = /bin/bash Можно свести с предыдущим коммитом (если его забирать), чтоб сразу был исправный. --  ---- WBR, Michael Shigorin / http://altlinux.org   ------ http://opennet.ru / http://anna-news.info --sdtB3X0nJg68CQEu Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0001-reports.mk-provide-bashism-with-bash.patch" >>From 9c4e1fee862c7c80f2fae2bd290a25b5b3d315f9 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Wed, 28 Apr 2021 16:29:46 +0300 Subject: [PATCH] reports.mk: provide bashism with bash Wrote that it's a bashism myself and neglected to specify the proper shell, sigh. This SHELL manipulation could ruin tracing piggybacked onto it within lib/report.mk but it's too late at this stage anyways. --- reports.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/reports.mk b/reports.mk index 247c722b5..f6020ce3c 100644 --- a/reports.mk +++ b/reports.mk @@ -77,6 +77,7 @@ reports/contents: reports/prep fi; \ esac +reports/packages: SHELL = /bin/bash reports/packages: reports/prep @grep -E 'chroot/.in/[^/]*.rpm' < $(BUILDLOG) | \ cut -d' ' -f 1 | tr -d "'"'`' | \ -- 2.25.4 --sdtB3X0nJg68CQEu--