diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-15 17:38:13 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-15 17:38:13 +0000 |
commit | f814943b4a4295f7a930fba28300e01a6c2cb3d7 (patch) | |
tree | e23fbf3f86fd4b7e41892c34514479bbdfa88eee | |
parent | 850ddca92ccf6f3885950f9db014c216cc99578c (diff) | |
download | perl-URPM-f814943b4a4295f7a930fba28300e01a6c2cb3d7.tar perl-URPM-f814943b4a4295f7a930fba28300e01a6c2cb3d7.tar.gz perl-URPM-f814943b4a4295f7a930fba28300e01a6c2cb3d7.tar.bz2 perl-URPM-f814943b4a4295f7a930fba28300e01a6c2cb3d7.tar.xz perl-URPM-f814943b4a4295f7a930fba28300e01a6c2cb3d7.zip |
(ranges_overlap,obsoletes_overlap) drop unused no_promote parameter
rationale: it was never set to 0 for nearly a decade
this should have been ripped rigth after commit r227323 by pixel
on Sep 7 2007:
"simplify: nopromoteepoch is always 1 (no caller ever define it)"
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | URPM.pm | 13 | ||||
-rw-r--r-- | URPM.xs | 18 | ||||
-rw-r--r-- | URPM/Resolve.pm | 2 |
4 files changed, 13 insertions, 22 deletions
@@ -1,4 +1,6 @@ - internal cleanups +- obsoletes_overlap(), ranges_overlap(): drop unused 'nopromotion' parameter + (always hardcoded to 1 at least for 5 years) Version 4.3 - 14 June 2012 @@ -320,7 +320,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 @@ -329,13 +329,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 @@ -636,7 +629,7 @@ Full obsoletes tags Just the obsoleted package name. -=item $package->obsoletes_overlap($s, [$nopromoteepoch, [$direction] ]) +=item $package->obsoletes_overlap($s, [$direction]) =item $package->os() @@ -654,7 +647,7 @@ Full provides tags Just the provided package name. -=item $package->provides_overlap($s, [$nopromoteepoch,] [$direction]) +=item $package->provides_overlap($s, [$direction]) =item $package->rate() @@ -236,7 +236,7 @@ print_list_entry(char *buff, int sz, const char *name, rpmsenseFlags flags, cons } static int -ranges_overlap(rpmsenseFlags aflags, char *sa, rpmsenseFlags bflags, char *sb, int b_nopromote) { +ranges_overlap(rpmsenseFlags aflags, char *sa, rpmsenseFlags bflags, char *sb) { if (!aflags || !bflags) return 1; /* really faster to test it there instead of later */ else { @@ -271,7 +271,7 @@ ranges_overlap(rpmsenseFlags aflags, char *sa, rpmsenseFlags bflags, char *sb, i 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 */ @@ -364,7 +364,6 @@ struct cb_overlap_s { rpmsenseFlags flags; char *evr; int direction; /* indicate to compare the above at left or right to the iteration element */ - int b_nopromote; }; static int @@ -409,9 +408,9 @@ callback_list_str_overlap(char *s, int slen, const char *name, rpmsenseFlags fla 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", @@ -1979,10 +1978,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 ALIAS: provides_overlap = 1 @@ -2022,7 +2020,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; @@ -2931,10 +2928,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; @@ -2964,7 +2960,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 diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index e0eaf9d..68c4aaa 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -513,7 +513,7 @@ sub unsatisfied_requires { if (my ($pn, $ps) = property2name_range($_)) { $ps or $state->{cached_installed}{$pn}{$p->fullname} = undef; $pn eq $n or next; - URPM::ranges_overlap($ps, $s, 1) and ++$satisfied; + URPM::ranges_overlap($ps, $s) and ++$satisfied; } } }); |