summaryrefslogtreecommitdiffstats
path: root/parse.cxx
diff options
context:
space:
mode:
authorfche <fche>2005-11-02 01:46:39 +0000
committerfche <fche>2005-11-02 01:46:39 +0000
commit5c74259593cafa36ea62cb9c8f4a6bb36a7565ab (patch)
tree340d75b88ea0b0d98d7581ce6e57f4de5dd08892 /parse.cxx
parentd23a2349f1932ed58bb64958a83766141b773b5a (diff)
downloadsystemtap-steved-5c74259593cafa36ea62cb9c8f4a6bb36a7565ab.tar.gz
systemtap-steved-5c74259593cafa36ea62cb9c8f4a6bb36a7565ab.tar.xz
systemtap-steved-5c74259593cafa36ea62cb9c8f4a6bb36a7565ab.zip
2005-11-01 Frank Ch. Eigler <fche@elastic.org>
Sound advice from <drepper@redhat.com>: * configure.ac: Undo last change. * configure.ac: Unregenerated. * parse.cxx: Use glibc strverscmp function instead of rpmlib. * stap.1.in: Update correspondingly.
Diffstat (limited to 'parse.cxx')
-rw-r--r--parse.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/parse.cxx b/parse.cxx
index 59251bdb..8430ba35 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -17,7 +17,6 @@
#include <cerrno>
#include <climits>
#include <sstream>
-#include "rpmlib.h" // for rpmvercmp
using namespace std;
@@ -160,7 +159,7 @@ bool eval_pp_conditional (systemtap_session& s,
throw parse_error ("expected string literal", r);
string query_kernel_vr = r->content;
- // collect acceptable rpmvercmp results.
+ // collect acceptable strverscmp results.
int rvc_ok1, rvc_ok2;
if (op->type == tok_operator && op->content == "<=")
{ rvc_ok1 = -1; rvc_ok2 = 0; }
@@ -177,10 +176,14 @@ bool eval_pp_conditional (systemtap_session& s,
else
throw parse_error ("expected comparison operator", op);
- int rvc_result = rpmvercmp ((l->content == "kernel_vr" ?
- target_kernel_vr.c_str() :
- target_kernel_v.c_str()),
- query_kernel_vr.c_str());
+ int rvc_result = strverscmp ((l->content == "kernel_vr" ?
+ target_kernel_vr.c_str() :
+ target_kernel_v.c_str()),
+ query_kernel_vr.c_str());
+ // normalize rvc_result
+ if (rvc_result < 0) rvc_result = -1;
+ if (rvc_result > 0) rvc_result = 1;
+
return (rvc_result == rvc_ok1 || rvc_result == rvc_ok2);
}