Commit 6f584cdc authored by Michael Shigorin's avatar Michael Shigorin Committed by Anton Midyukov

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 process substitution along with good ol' tee(1) like this: $ echo -e '1\n2\n3' |tee /dev/stderr 2> >(grep 2 >STDERR) |grep 1 >STDOUT $ head STD* ==> STDERR <== 2 ==> STDOUT <== 1
parent 4c701def
......@@ -79,10 +79,9 @@ reports/contents: reports/prep
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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment