diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-10-13 17:54:11 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-10-13 17:54:11 +0000 |
commit | 1437062907a4c5b5a3da162f6b8575abe6083b6a (patch) | |
tree | 4f6d165cc871b04f492ca69166621d42a5c9b21c | |
parent | 81d7650da8a828c76c202ac301dc337ba3952b56 (diff) | |
download | perl-URPM-1437062907a4c5b5a3da162f6b8575abe6083b6a.tar perl-URPM-1437062907a4c5b5a3da162f6b8575abe6083b6a.tar.gz perl-URPM-1437062907a4c5b5a3da162f6b8575abe6083b6a.tar.bz2 perl-URPM-1437062907a4c5b5a3da162f6b8575abe6083b6a.tar.xz perl-URPM-1437062907a4c5b5a3da162f6b8575abe6083b6a.zip |
drop legacy behaviour, always promote epoch
-rw-r--r-- | URPM.pm | 13 | ||||
-rw-r--r-- | URPM.xs | 22 |
2 files changed, 11 insertions, 24 deletions
@@ -311,7 +311,7 @@ parse_synthesis()). Force the re-reading of the RPM configuration files. -=item URPM::ranges_overlap($range1, $range2 [, $nopromoteepoch]) +=item URPM::ranges_overlap($range1, $range2) This utility function compares two version ranges, in order to calculate dependencies properly. The ranges have roughly the form @@ -320,13 +320,6 @@ dependencies properly. The ranges have roughly the form where epoch, version and release are RPM-style version numbers. -If the optional parameter $nopromoteepoch is true, and if the 2nd range has no -epoch while the first one has one, then the 2nd range is assumed to have an -epoch C<== 0>. - -B<Warning>: $nopromoteepoch actually defaults to 1, so if you're going to -pass a variable, make sure undef is treated like 1, not 0. - =item $urpm->parse_synthesis($file [, callback => sub {...} ]) This method gets the B<depslist> and the B<provides> from a synthesis file @@ -616,7 +609,7 @@ The rpm's bare name. =item $package->obsoletes_nosense() -=item $package->obsoletes_overlap($s, [$nopromoteepoch, [$direction] ]) +=item $package->obsoletes_overlap($s, [$direction]) =item $package->os() @@ -630,7 +623,7 @@ The rpm's bare name. =item $package->provides_nosense() -=item $package->provides_overlap($s, [$nopromoteepoch,] [$direction]) +=item $package->provides_overlap($s, [$direction]) =item $package->rate() @@ -343,7 +343,7 @@ print_list_entry(char *buff, int sz, const char *name, uint32_t flags, const cha } static int -ranges_overlap(uint32_t aflags, char *sa, uint32_t bflags, char *sb, int b_nopromote) { +ranges_overlap(uint32_t aflags, char *sa, uint32_t bflags, char *sb) { if (!aflags || !bflags) return 1; /* really faster to test it there instead of later */ else { @@ -378,7 +378,7 @@ ranges_overlap(uint32_t aflags, char *sa, uint32_t bflags, char *sb, int b_nopro if (ea && eb) sense = rpmvercmp(*ea ? ea : "0", *eb ? eb : "0"); else if (ea && *ea && atol(ea) > 0) - sense = b_nopromote ? 1 : 0; + sense = 1; else if (eb && *eb && atol(eb) > 0) sense = -1; /* now compare version and release if epoch has not been enough */ @@ -471,7 +471,6 @@ struct cb_overlap_s { int32_t flags; char *evr; int direction; /* indicate to compare the above at left or right to the iteration element */ - int b_nopromote; }; static int @@ -509,9 +508,9 @@ callback_list_str_overlap(char *s, int slen, const char *name, uint32_t flags, c if (!strcmp(name, os->name)) { /* perform overlap according to direction needed, negative for left */ if (os->direction < 0) - result = ranges_overlap(os->flags, os->evr, flags, (char *) evr, os->b_nopromote); + result = ranges_overlap(os->flags, os->evr, flags, (char *) evr); else - result = ranges_overlap(flags, (char *) evr, os->flags, os->evr, os->b_nopromote); + result = ranges_overlap(flags, (char *) evr, os->flags, os->evr); } /* fprintf(stderr, "cb_list_str_overlap result=%d, os->direction=%d, os->name=%s, os->evr=%s, name=%s, evr=%s\n", @@ -2155,10 +2154,9 @@ Pkg_obsoletes_nosense(pkg) SPAGAIN; int -Pkg_obsoletes_overlap(pkg, s, b_nopromote=1, direction=-1) +Pkg_obsoletes_overlap(pkg, s, direction=-1) URPM::Package pkg char *s - int b_nopromote int direction PREINIT: struct cb_overlap_s os; @@ -2182,7 +2180,6 @@ Pkg_obsoletes_overlap(pkg, s, b_nopromote=1, direction=-1) } else os.evr = ""; os.direction = direction; - os.b_nopromote = b_nopromote; /* mark end of name */ if (eon) { eonc = *eon; *eon = 0; } /* return_list_str returns a negative value is the callback has returned non-zero */ @@ -2228,10 +2225,9 @@ Pkg_provides_nosense(pkg) SPAGAIN; int -Pkg_provides_overlap(pkg, s, b_nopromote=1, direction=1) +Pkg_provides_overlap(pkg, s, direction=1) URPM::Package pkg char *s - int b_nopromote int direction PREINIT: struct cb_overlap_s os; @@ -2255,7 +2251,6 @@ Pkg_provides_overlap(pkg, s, b_nopromote=1, direction=1) } else os.evr = ""; os.direction = direction; - os.b_nopromote = b_nopromote; /* mark end of name */ if (eon) { eonc = *eon; *eon = 0; } /* return_list_str returns a negative value is the callback has returned non-zero */ @@ -3388,10 +3383,9 @@ rpmvercmp(one, two) char *two int -Urpm_ranges_overlap(a, b, b_nopromote=1) +Urpm_ranges_overlap(a, b) char *a char *b - int b_nopromote PREINIT: char *sa = a, *sb = b; int aflags = 0, bflags = 0; @@ -3421,7 +3415,7 @@ Urpm_ranges_overlap(a, b, b_nopromote=1) else break; ++sb; } - RETVAL = ranges_overlap(aflags, sa, bflags, sb, b_nopromote); + RETVAL = ranges_overlap(aflags, sa, bflags, sb); } OUTPUT: RETVAL |