aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-06-11 17:59:04 +0000
committerFrancois Pons <fpons@mandriva.com>2002-06-11 17:59:04 +0000
commit74c3cfe40e76d2cf047e7cbc57653298a460b658 (patch)
tree0455e964846482182d896763b9819646a6239a87 /URPM.xs
parenta3d672d23de228cb2955f5825869154b77a7f5e0 (diff)
downloadperl-URPM-74c3cfe40e76d2cf047e7cbc57653298a460b658.tar
perl-URPM-74c3cfe40e76d2cf047e7cbc57653298a460b658.tar.gz
perl-URPM-74c3cfe40e76d2cf047e7cbc57653298a460b658.tar.bz2
perl-URPM-74c3cfe40e76d2cf047e7cbc57653298a460b658.tar.xz
perl-URPM-74c3cfe40e76d2cf047e7cbc57653298a460b658.zip
0.04-1mdk
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs53
1 files changed, 53 insertions, 0 deletions
diff --git a/URPM.xs b/URPM.xs
index fcaee43..3d238ab 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1446,6 +1446,59 @@ Db_traverse_tag(db,tag,names,callback)
MODULE = URPM PACKAGE = URPM PREFIX = Urpm_
+int
+Urpm_ranges_overlap(a, b)
+ char *a
+ char *b
+ PREINIT:
+ char *sa = a, *sb = b;
+ int aflags = 0, bflags = 0;
+ char *eona, *eonb;
+ char *eosa, *eosb;
+ char save_a, save_b;
+ CODE:
+ while (*sa && *sa != ' ' && *sa != '[') ++sa; save_a = *sa; *(eona = sa++) = 0;
+ while (*sb && *sb != ' ' && *sb != '[') ++sb; save_b = *sb; *(eonb = sb++) = 0;
+ if (save_a)
+ while (*sa) {
+ switch (*sa++) {
+ case '<': aflags |= RPMSENSE_LESS; break;
+ case '>': aflags |= RPMSENSE_GREATER; break;
+ case '=': aflags |= RPMSENSE_EQUAL; break;
+ case ' ':
+ case '[':
+ case '*':
+ case ']':
+ break;
+ default: goto exit_a;
+ }
+ }
+exit_a:
+ if (save_b)
+ while (*sb) {
+ switch (*sb++) {
+ case '<': bflags |= RPMSENSE_LESS; break;
+ case '>': bflags |= RPMSENSE_GREATER; break;
+ case '=': bflags |= RPMSENSE_EQUAL; break;
+ case ' ':
+ case '[':
+ case '*':
+ case ']':
+ break;
+ default: goto exit_b;
+ }
+ }
+exit_b:
+ if ((eosa = strchr(--sa, ']')) != NULL) *eosa = 0;
+ if ((eosb = strchr(--sb, ']')) != NULL) *eosb = 0;
+ RETVAL = rpmRangesOverlap(a, sa, aflags, b, sb, bflags);
+ if (eosb) *eosb = ']';
+ if (eosa) *eosa = ']';
+ *eonb = save_b;
+ *eona = save_a;
+ OUTPUT:
+ RETVAL
+
void
Urpm_parse_synthesis(urpm, filename)
SV *urpm