From 9888451aac0af2e8a44f38b2972af7f125422652 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Sun, 1 Jan 2017 17:52:12 +0200
Subject: [PATCH 1/4] Ticket #3751: extfs: rpm: introduce the $RPM_QUERY_FMT
variable.
This minor refactoring will enable us to make this helper testable.
Instead of doing:
$RPM -qp --qf a b c
we are now doing:
$RPM_QUERY_FMT a b c
In a future patch we'll then be able to point $RPM_QUERY_FMT to some mock
program.
Signed-off-by: Mooffie <mooffie@gmail.com>
---
src/vfs/extfs/helpers/rpm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/vfs/extfs/helpers/rpm b/src/vfs/extfs/helpers/rpm
index 4a01453..454a9c0 100755
a
|
b
|
if rpm --nosignature --version >/dev/null 2>&1; then |
64 | 64 | else |
65 | 65 | RPM="rpm" |
66 | 66 | fi |
| 67 | RPM_QUERY_FMT="$RPM -qp --qf" |
67 | 68 | RPM2CPIO="rpm2cpio" |
68 | 69 | |
69 | 70 | SED="sed" |
… |
… |
mcrpmfs_getAllNeededTags() |
92 | 93 | tag_CONFLICTS="" |
93 | 94 | fi |
94 | 95 | |
95 | | $RPM -qp --qf \ |
| 96 | $RPM_QUERY_FMT \ |
96 | 97 | "|NAME=%{NAME}"\ |
97 | 98 | "|VERSION=%{VERSION}"\ |
98 | 99 | "|RELEASE=%{RELEASE}"\ |
… |
… |
${tag_CONFLICTS}\ |
113 | 114 | |
114 | 115 | mcrpmfs_getRawOneTag() |
115 | 116 | { |
116 | | $RPM -qp --qf "$1" "${rpm_filename}" |
| 117 | $RPM_QUERY_FMT "$1" "${rpm_filename}" |
117 | 118 | } |
118 | 119 | |
119 | 120 | mcrpmfs_getOneTag() |