Dirk Mueller 2023-08-10 10:27:03 +00:00 committed by Git OBS Bridge
parent e0b7e44ebe
commit 78a4656943

View File

@ -1,11 +1,27 @@
--- rpmpopt.in.orig 2022-04-07 13:13:19.072518377 +0200
+++ rpmpopt.in 2023-08-08 13:45:57.992531046 +0200
@@ -125,7 +125,7 @@
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' \
-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))}' " \
+ --pipe "LC_NUMERIC=C sort -r -n | sed -E 's,^[0-9]+ ([^[:blank:]]+) +(.+)$,printf "'"%-45s %s\n"'" \1 "'"\2"'",e'" \
+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" \