reports.mk: streamline basedir(1) equivalent

That "clever hack" with two rev(1) invocations
seems pretty stupid to me: too much processes
and processing instead of simple prefix removal.

One can also have that as ${var##*/} when dealing
with a shell variable and avoiding extra forks, BTW.
This commit is contained in:
Michael Shigorin 2021-04-28 14:50:06 +03:00 committed by Anton Midyukov
parent 4a419e6bbb
commit 4c701def7c

View File

@ -79,8 +79,7 @@ reports/contents: reports/prep
reports/packages: reports/prep
@grep -E 'chroot/.in/[^/]*.rpm' < $(BUILDLOG) | \
cut -d' ' -f 1 | tr -d "'"'`' | \
rev | cut -d'/' -f 1 | rev | \
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 "'"'`' | \