diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-06-23 08:53:36 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-06-23 08:53:36 +0000 |
commit | 468ab86777f458a461b4f6e834be588dd42e576a (patch) | |
tree | ee784fae04dc5da9b64efe4c7d59ffcba0692039 | |
parent | 848716860b8a8fb02721364f4d6d10ad5b1a312a (diff) | |
download | perl-URPM-468ab86777f458a461b4f6e834be588dd42e576a.tar perl-URPM-468ab86777f458a461b4f6e834be588dd42e576a.tar.gz perl-URPM-468ab86777f458a461b4f6e834be588dd42e576a.tar.bz2 perl-URPM-468ab86777f458a461b4f6e834be588dd42e576a.tar.xz perl-URPM-468ab86777f458a461b4f6e834be588dd42e576a.zip |
add support for specifying tag name to match with URPM::Transaction->remove()
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | URPM.pm | 5 | ||||
-rw-r--r-- | URPM.xs | 8 |
3 files changed, 11 insertions, 5 deletions
@@ -1,5 +1,6 @@ -Version 4.34 - 21 June 2011, by Per Øyvid Karlsen +Version 4.34 - 23 June 2011, by Per Øyvid Karlsen +- add support for specifying tag name to match with URPM::Transaction->remove() - add some regression tests for parsing disttag & distepoch from synthesis - extract disttag & distepoch from new fields in @info@ of synthesis @@ -712,10 +712,11 @@ Options are: update => 0 / 1 : indicates whether this is an upgrade excludepath => [ ... ] -=item $trans->remove($name) +=item $trans->remove($keyp, [$tagname = "nvra"]) Adds a package to be erased to the transaction represented by $trans. -$name is the name of the package. +$keyp is by default the full name of the package, unless a different tag to +match has been specified with $tagname. =item $trans->check(%options) @@ -3627,15 +3627,19 @@ Trans_add(trans, pkg, ...) RETVAL int -Trans_remove(trans, name) +Trans_remove(trans, name, tagname = NULL) URPM::Transaction trans char *name + char *tagname PREINIT: Header h; rpmmi mi; int count = 0; + rpmTag tag = RPMTAG_NVRA; CODE: - mi = rpmtsInitIterator(trans->ts, RPMTAG_NVRA, name, 0); + if (tagname) + tag = rpmtag_from_string(tagname); + mi = rpmtsInitIterator(trans->ts, tag, name, 0); while ((h = rpmmiNext(mi))) { unsigned int recOffset = rpmmiInstance(mi); if (recOffset != 0) { |