From 78a4656943c0272b51265ae2686bed75fe09b1f412507abeac02081a9e7a0a84 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 10 Aug 2023 10:27:03 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=639 --- remove-awk-dependency.patch | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/remove-awk-dependency.patch b/remove-awk-dependency.patch index 88d5999..6685485 100644 --- a/remove-awk-dependency.patch +++ b/remove-awk-dependency.patch @@ -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?= +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" \