Bug 110226 - [RFE] [rpm-python] hdrobject[rpm.RPMTAG_REQUIREFLAGS] should always return a list object
Summary: [RFE] [rpm-python] hdrobject[rpm.RPMTAG_REQUIREFLAGS] should always return a ...
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm   
(Show other bugs)
Version: 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
URL: https://lists.dulug.duke.edu/pipermai...
Whiteboard:
Keywords: FutureFeature
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-17 10:03 UTC by Paul Nasrat
Modified: 2014-01-21 22:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-30 15:47:29 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Simple unit test (795 bytes, text/plain)
2003-12-29 12:16 UTC, Paul Nasrat
no flags Details

Description Paul Nasrat 2003-11-17 10:03:21 UTC
Description of problem:

As requested in your email to the list this is a tracker bug for the
RFE to change the behaviour or this to always return a list.  I will
poke the key rpm-python api users to add a comment signing off this
change.

Version-Release number of selected component (if applicable):

4.2.1

How reproducible:

Always

Comment 1 Jeff Johnson 2003-11-17 11:10:38 UTC
Ready, willing and able whenever.

Comment 2 Panu Matilainen 2003-11-17 13:30:57 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
  
I hardly qualify as "a major user" but here's my humble +1 for this change
anyway, would make life just that little bit easier with rpm-python.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
  
iD8DBQE/uM2ula5U8jydsKoRAgVkAJwI1zcu61ncU/0rtw8AKsnMsaijLwCgh/6o
LUtxpVQ+2lUGPQ1Yh5lefXE=
=6pzO
-----END PGP SIGNATURE-----


Comment 3 Seth Vidal 2003-11-17 13:54:12 UTC
this should be the same for requires,provides, conflicts and obsoletes.

Hell in general everything that can return a list object should always
return a list object, even when it is empty.


Comment 4 Ville Skyttä 2003-11-25 21:57:13 UTC
+1 to lists and comment 3.

Comment 5 Jeff Johnson 2003-12-18 12:11:38 UTC
I do not have sign off from alikins, sopwith, nor katzj, and
hence cannot make the change. Possibly timp needs ack too.

Reopen if/when necessary signoff is acquired.

Comment 6 Tim Powers 2003-12-18 13:38:21 UTC
I concur with Seth's comment (#3). The same object should be returned
regardless of length. If it's going to return a list of ints, it
should always be a list of ints (even if there's nothing to return,
return an empty list), if it can return a list of strings, it should
always return a list...as so on.

Comment 7 Elliot Lee 2003-12-18 13:52:16 UTC
Yes, if the tag normally is a list but has zero elements in the
header,  return an empty list.

Comment 8 Jeremy Katz 2003-12-18 15:42:15 UTC
I don't hvae any problem with this that I can think of.

Comment 9 Adrian Likins 2003-12-18 18:27:13 UTC
sure

Comment 10 Jeff Johnson 2003-12-18 18:55:54 UTC
Wheee, consensus!

Comment 11 Paul Nasrat 2003-12-29 12:16:12 UTC
Created attachment 96720 [details]
Simple unit test

This is fixed in HEAD and rpm-4_2 and in rpm-4.2.2-0.8

python
>>> import rpm
>>> ts=rpm.TransactionSet()
>>> hdr=ts.dbMatch("Name","rpm").next()
>>> hdr[rpm.RPMTAG_OBSOLETEFLAGS]
[2]


python test_obs.py
...
----------------------------------------------------------------------
Ran 3 tests in 0.060s
 
OK


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