aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-06-23 08:53:36 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-06-23 08:53:36 +0000
commit468ab86777f458a461b4f6e834be588dd42e576a (patch)
treeee784fae04dc5da9b64efe4c7d59ffcba0692039
parent848716860b8a8fb02721364f4d6d10ad5b1a312a (diff)
downloadperl-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--NEWS3
-rw-r--r--URPM.pm5
-rw-r--r--URPM.xs8
3 files changed, 11 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index da12967..36bcddb 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/URPM.pm b/URPM.pm
index 7de3fec..7bff76a 100644
--- a/URPM.pm
+++ b/URPM.pm
@@ -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)
diff --git a/URPM.xs b/URPM.xs
index 6c83387..b0a361b 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -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) {