From 4b19e5f345e39ed8c3350e6acc7179d26c6e4526 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 17 May 2014 21:30:20 +0200 Subject: (compare) croak if used on URPM::Package object (mga#12766) suggests to use compare_pkg instead (needs a new rpmdrake) --- NEWS | 1 + URPM.xs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 8662f51..d7af4a2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- compare(): croak if used on URPM::Package object (mga#12766) - enhanced doc - kill support for kernel-*source-stripped diff --git a/URPM.xs b/URPM.xs index b1c3f72..50091a8 100644 --- a/URPM.xs +++ b/URPM.xs @@ -1711,6 +1711,8 @@ Pkg_compare(pkg, evr) croak("undefined package"); char *epoch = NULL, *version, *release; + if (!strncmp(evr, "URPM::Package=", 14)) + croak("compare() must not be called with a package reference as argument; use compare_pkg() instead"); /* extract epoch and version from evr */ version = evr; -- cgit v1.2.1