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