28 lines
1.4 KiB
Diff
28 lines
1.4 KiB
Diff
From 224095542246e762617d38e2096fdeba13d266e3 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Dirk=20M=C3=BCller?= <dirk@dmllr.de>
|
|
Date: Tue, 8 Aug 2023 13:53:38 +0200
|
|
Subject: [PATCH] Rewrite --last to just use sed for formatting
|
|
|
|
This is the only dependency on awk in the runtime commandline part of
|
|
rpm, which is bloating minimal container images a bit. We can rewrite
|
|
that into a single sed statement. We love you anyway, awk.
|
|
---
|
|
rpmpopt.in | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/rpmpopt.in b/rpmpopt.in
|
|
index 8022b0f54a..1223e1a862 100644
|
|
--- ./rpmpopt.in
|
|
+++ ./rpmpopt.in
|
|
@@ -133,8 +133,8 @@ rpm alias --filetriggerscripts --qf '\
|
|
rpm alias --filetriggers --filetriggerscripts \
|
|
--POPTdesc=$"list filetrigger scriptlets from package(s)"
|
|
|
|
-rpm alias --last --qf '%|INSTALLTIME?{%{INSTALLTIME}}:{000000000}| %{NVRA} %|INSTALLTIME?{%{INSTALLTIME:date}}:{(not installed)}|\n' \
|
|
- --pipe "LC_NUMERIC=C sort -r -n | sed 's,^[0-9]\+ ,,' | awk '{printf(\"%-45s %-s\n\", $1, substr($0,length($1)+2))}' " \
|
|
+rpm alias --last --qf '%|INSTALLTIME?{%{INSTALLTIME}}:{000000000}| %-45{NVRA} %|INSTALLTIME?{%{INSTALLTIME:date}}:{(not installed)}|\n' \
|
|
+ --pipe "LC_NUMERIC=C sort -r -n | sed 's,^[0-9]\+ ,,' " \
|
|
--POPTdesc=$"list package(s) by install time, most recent first"
|
|
|
|
rpm alias --dupes --qf '%|SOURCERPM?{%{name}.%{arch}}:{%|ARCH?{%{name}}:{%{name}-%{version}}|}|\n' --pipe "sort | uniq -d" \
|