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>
This commit is contained in:
Mooffie 2017-01-01 17:52:12 +02:00
parent 3078e74afe
commit 65ebc83f88
1 changed files with 3 additions and 2 deletions

View File

@ -64,6 +64,7 @@ if rpm --nosignature --version >/dev/null 2>&1; then
else
RPM="rpm"
fi
RPM_QUERY_FMT="$RPM -qp --qf"
RPM2CPIO="rpm2cpio"
SED="sed"
@ -92,7 +93,7 @@ mcrpmfs_getAllNeededTags()
tag_CONFLICTS=""
fi
$RPM -qp --qf \
$RPM_QUERY_FMT \
"|NAME=%{NAME}"\
"|VERSION=%{VERSION}"\
"|RELEASE=%{RELEASE}"\
@ -113,7 +114,7 @@ ${tag_CONFLICTS}\
mcrpmfs_getRawOneTag()
{
$RPM -qp --qf "$1" "${rpm_filename}"
$RPM_QUERY_FMT "$1" "${rpm_filename}"
}
mcrpmfs_getOneTag()