From 4c701def7c1a71ca03fad0cad8092659fcfd1344 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Wed, 28 Apr 2021 14:50:06 +0300 Subject: [PATCH] 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. --- reports.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reports.mk b/reports.mk index 0e44c447..7b81e785 100644 --- a/reports.mk +++ b/reports.mk @@ -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 "'"'`' | \