supermin/0003-rpm-Don-t-both-verifying-signatures-and-digests-when.patch
2014-10-07 15:27:35 +02:00

62 lines
2.0 KiB
Diff

From 7c3984e45b91f8a78530efe6ddfc7a83556892ec Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 15 Sep 2014 13:51:06 +0100
Subject: [PATCH] rpm: Don't both verifying signatures and digests when reading
RPM metadata.
supermin doesn't care, and there's a performance penalty for
doing it.
Thanks: Panu Matilainen
---
src/rpm.ml | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/rpm.ml b/src/rpm.ml
index 434f15b..1195948 100644
--- a/src/rpm.ml
+++ b/src/rpm.ml
@@ -136,7 +136,7 @@ let rpm_package_of_string str =
* ourselves. *)
let parse_rpm str =
let cmd =
- sprintf "%s -q --qf '%%{name} %%{epoch} %%{version} %%{release} %%{arch}\\n' %s"
+ sprintf "%s --nosignature --nodigest -q --qf '%%{name} %%{epoch} %%{version} %%{release} %%{arch}\\n' %s"
Config.rpm
(quote str) in
let lines = run_command_get_lines cmd in
@@ -177,7 +177,8 @@ let rpm_package_of_string str =
(* Check if an RPM is installed. *)
and check_rpm_installed name =
- let cmd = sprintf "%s -q %s >/dev/null" Config.rpm (quote name) in
+ let cmd = sprintf "%s --nosignature --nodigest -q %s >/dev/null"
+ Config.rpm (quote name) in
0 = Sys.command cmd
in
@@ -227,9 +228,9 @@ let rpm_get_package_database_mtime () =
let rpm_get_all_requires pkgs =
let get pkgs =
let cmd = sprintf "\
- %s -qR %s |
+ %s --nosignature --nodigest -qR %s |
awk '{print $1}' |
- xargs rpm -q --qf '%%{name}\\n' --whatprovides |
+ xargs rpm --nosignature --nodigest -q --qf '%%{name}\\n' --whatprovides |
grep -v 'no package provides' |
sort -u"
Config.rpm
@@ -251,7 +252,7 @@ let rpm_get_all_requires pkgs =
let rpm_get_all_files pkgs =
let cmd = sprintf "\
- %s -q --qf '[%%{FILENAMES}\\t%%{FILEFLAGS:fflags}\\n]' %s |
+ %s --nosignature --nodigest -q --qf '[%%{FILENAMES}\\t%%{FILEFLAGS:fflags}\\n]' %s |
grep '^/' |
sort -u"
Config.rpm
--
1.9.3