Do not let 'rpm -q foo-' find package 'foo'. (RhBug:488567)
- Includes a test suite for the case. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
This commit is contained in:
parent
1581f4e5c0
commit
1c8e56729d
|
@ -1142,9 +1142,9 @@ static rpmRC dbiFindByLabel(rpmdb db, dbiIndex dbi, const char * arg,
|
|||
if (c != '[') brackets = 0;
|
||||
break;
|
||||
}
|
||||
c = *s;
|
||||
if (!brackets && *s == '-')
|
||||
if (!brackets && c && *s == '-')
|
||||
break;
|
||||
c = *s;
|
||||
}
|
||||
|
||||
/* FIX: *matches may be NULL. */
|
||||
|
@ -1175,9 +1175,9 @@ static rpmRC dbiFindByLabel(rpmdb db, dbiIndex dbi, const char * arg,
|
|||
if (c != '[') brackets = 0;
|
||||
break;
|
||||
}
|
||||
c = *s;
|
||||
if (!brackets && *s == '-')
|
||||
if (!brackets && c && *s == '-')
|
||||
break;
|
||||
c = *s;
|
||||
}
|
||||
|
||||
if (s == localarg) {
|
||||
|
|
|
@ -44,6 +44,45 @@ runroot rpm \
|
|||
[0])
|
||||
AT_CLEANUP
|
||||
|
||||
# ------------------------------
|
||||
# Run rpm -q <package> where <package> exists in the db.
|
||||
AT_SETUP([rpm -q foo])
|
||||
AT_KEYWORDS([rpmdb query])
|
||||
AT_CHECK([
|
||||
RPMDB_CLEAR
|
||||
RPMDB_INIT
|
||||
|
||||
runroot rpm -i \
|
||||
/data/RPMS/foo-1.0-1.noarch.rpm
|
||||
|
||||
runroot rpm -q foo
|
||||
|
||||
],
|
||||
[0],
|
||||
[foo-1.0-1.noarch
|
||||
],
|
||||
[])
|
||||
AT_CLEANUP
|
||||
|
||||
# ------------------------------
|
||||
# Run rpm -q <package>- where <package> exists in the db.
|
||||
AT_SETUP([rpm -q foo-])
|
||||
AT_KEYWORDS([rpmdb query])
|
||||
AT_CHECK([
|
||||
RPMDB_CLEAR
|
||||
RPMDB_INIT
|
||||
|
||||
runroot rpm -i \
|
||||
/data/RPMS/foo-1.0-1.noarch.rpm
|
||||
|
||||
runroot rpm -q foo-
|
||||
|
||||
],
|
||||
[1],
|
||||
[package foo- is not installed
|
||||
],
|
||||
[])
|
||||
AT_CLEANUP
|
||||
|
||||
# ------------------------------
|
||||
# install a noarch package into a local rpmdb without --relocate and --nodeps
|
||||
|
|
Loading…
Reference in New Issue