Bug 657513 - When queryformat has %{PREFIXES} and %{INSTPREFIXES}, multiple prefixes are not outputed
Summary: When queryformat has %{PREFIXES} and %{INSTPREFIXES}, multiple prefixes are n...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm
Version: 5.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-26 10:20 UTC by Masahiro Matsuya
Modified: 2011-03-15 13:58 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-29 07:21:42 UTC
Target Upstream Version:


Attachments (Terms of Use)
foo-1.0-0.x86_64.rpm (2.15 KB, application/x-rpm)
2010-11-26 10:20 UTC, Masahiro Matsuya
no flags Details
foo-1.0-0.src.rpm (2.24 KB, application/x-rpm)
2010-11-26 10:20 UTC, Masahiro Matsuya
no flags Details

Description Masahiro Matsuya 2010-11-26 10:20:04 UTC
Created attachment 463050 [details]
foo-1.0-0.x86_64.rpm

Description of problem:
When queryformat has %{PREFIXES} and %{INSTPREFIXES}, multiple prefixes are not outputed.

# cat foo.spec 
Name: foo
Version: 1.0
Release: 0
License: GPL
Group: Applications/Internet

Source0: foo.tar.gz

Prefix: /usr
Prefix: /opt
... snip ...

# rpm -qip /usr/src/redhat/RPMS/x86_64/foo-1.0-0.x86_64.rpm
Name        : foo                          Relocations: /usr /opt 
Version     : 1.0                               Vendor: (none)
Release     : 0                             Build Date: Fri 26 Nov 2010 05:06:34 AM EST
Install Date: (not installed)               Build Host: test.redhat.com
Group       : Applications/Internet         Source RPM: foo-1.0-0.src.rpm
Size        : 20                               License: GPL
Signature   : (none)
Summary     : foo application
Description :
foo application

# rpm -ihv /usr/src/redhat/RPMS/x86_64/foo-1.0-0.x86_64.rpm
Preparing...                ########################################### [100%]
   1:foo                    ########################################### [100%]

# rpm -q --qf="%{PREFIXES}\n" foo
/usr

==> /opt is not outputed.

# rpm -ev foo
# rpm -ihv --relocate /usr=/test --relocate /opt=/test1 /usr/src/redhat/RPMS/x86_64/foo-1.0-0.x86_64.rpm
Preparing...                ########################################### [100%]
   1:foo                    ########################################### [100%]

# rpm -q --qf="%{PREFIXES}\n" foo
/usr

==> /opt is not outputed.

# rpm -q --qf="%{INSTPREFIXES}\n" foo
/test

==> /test1 is not outputed.


Version-Release number of selected component (if applicable):
rpm-4.4.2.3-18.el5

How reproducible:
Always

Steps to Reproduce:
1. install foo package I attached
2. query with rpm -q --qf
  
Actual results:
multiple prefix are not outputed.

Expected results:
multiple prefix are outputed.

Additional info:

Comment 1 Masahiro Matsuya 2010-11-26 10:20:38 UTC
Created attachment 463051 [details]
foo-1.0-0.src.rpm

Comment 2 Panu Matilainen 2010-11-29 07:21:42 UTC
PREFIXES and INSTPREFIXES are arrays and need a special queryformat syntax to show all the contents:
"[%{PREFIXES}\n]" and "[%{INSTPREFIXES}\n]"


Note You need to log in before you can comment on or make changes to this bug.