aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-07-24 12:36:52 +0000
committerFrancois Pons <fpons@mandriva.com>2002-07-24 12:36:52 +0000
commit4cf5682cf59a7547e263b74b744515597aec873e (patch)
tree09e915d7844aa63aa26b7814ec0fe8c2d834e14d
parent9a3a55e34e01d4dba1eb5a09ba25eb3c59101173 (diff)
downloadperl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar.gz
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar.bz2
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.tar.xz
perl-URPM-4cf5682cf59a7547e263b74b744515597aec873e.zip
0.50-4mdk
-rw-r--r--URPM.xs15
-rw-r--r--URPM/Build.pm10
-rw-r--r--URPM/Resolve.pm17
-rw-r--r--perl-URPM.spec9
4 files changed, 25 insertions, 26 deletions
diff --git a/URPM.xs b/URPM.xs
index b87f7d5..5486ac0 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -406,14 +406,11 @@ update_provides(URPM__Package pkg, HV *provides) {
if (list) {
for (i = 0; i < count; ++i) {
len = strlen(list[i]);
- if (!strncmp(list[i], "rpmlib(", 7)) continue;
if (list[i][0] == '/') hv_fetch(provides, list[i], len, 1);
}
}
/* update all provides */
- /* headerGetEntry(pkg->h, RPMTAG_PROVIDEVERSION, &type, (void **) &list_evr, &count);
- headerGetEntry(pkg->h, RPMTAG_PROVIDEFLAGS, &type, (void **) &flags, &count); */
headerGetEntry(pkg->h, RPMTAG_PROVIDENAME, &type, (void **) &list, &count);
if (list) {
for (i = 0; i < count; ++i) {
@@ -423,15 +420,21 @@ update_provides(URPM__Package pkg, HV *provides) {
}
}
} else {
- char *ps, *s;
+ char *ps, *s, *es;
if ((s = pkg->requires) != NULL && *s != 0) {
ps = strchr(s, '@');
while(ps != NULL) {
- if (s[0] == '/') hv_fetch(provides, s, ps-s, 1);
+ if (s[0] == '/') {
+ *ps = 0; es = strchr(s, '['); if (!es) es = strchr(s, ' '); *ps = '@';
+ hv_fetch(provides, s, es != NULL ? es-s : ps-s, 1);
+ }
s = ps + 1; ps = strchr(s, '@');
}
- if (s[0] == '/') hv_fetch(provides, s, strlen(s), 1);
+ if (s[0] == '/') {
+ es = strchr(s, '['); if (!es) es = strchr(s, ' ');
+ hv_fetch(provides, s, es != NULL ? es-s : strlen(s), 1);
+ }
}
if ((s = pkg->provides) != NULL && *s != 0) {
diff --git a/URPM/Build.pm b/URPM/Build.pm
index e3029f7..2c1a592 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -75,19 +75,13 @@ sub parse_rpms_build_headers {
@headers;
}
-#- check if rereading of hdlist is neccessary.
+#- allow rereading of hdlist and clean.
sub unresolved_provides_clean {
my ($urpm) = @_;
- my @unresolved = grep { ! defined $urpm->{provides}{$_} } keys %{$urpm->{provides} || {}};
+ my @potentially_unresolved = keys %{$urpm->{provides} || {}};
- #- names can be safely removed in any cases.
- delete $urpm->{names};
-
- #- remove
@{$urpm}{qw(depslist provides)} = ([], {});
@{$urpm->{provides}}{@unresolved} = ();
-
- @unresolved;
}
#- read a list of headers (typically when building an hdlist when provides have
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 5cd8392..52075e8 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -285,6 +285,7 @@ sub resolve_requested {
my $best = join '|', map { $_->id }
grep { $urpm->unsatisfied_requires($db, $state, $_, name => $n) == 0 }
@{$packages->{$p->name}};
+
if ($best) {
push @properties, $best;
} else {
@@ -325,18 +326,12 @@ sub resolve_requested {
#- the existing package will conflicts with selection, check if a newer
#- version will be ok, else ask to remove the old.
my $packages = $urpm->find_candidate_packages($p->name);
- my $best;
- foreach (@{$packages->{$p->name}}) {
- unless (grep { ranges_overlap($_, $property) } $_->provides) {
- if ($best && $best != $_) {
- $_->compare_pkg($best) > 0 and $best = $_;
- } else {
- $best = $_;
- }
- }
- }
+ my $best = join '|', map { $_->id }
+ grep { ! grep { ranges_overlap($_, $property) } $_->provides }
+ @{$packages->{$p->name}};
+
if ($best) {
- push @properties, $best->id;
+ push @properties, $best;
} else {
#- no package have been found, we need to remove the package examined.
$options{keep_state} or
diff --git a/perl-URPM.spec b/perl-URPM.spec
index bdcb73d..fec64dc 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.50
-%define release 3mdk
+%define release 4mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -48,6 +48,13 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Wed Jul 24 2002 François Pons <fpons@mandrakesoft.com> 0.50-4mdk
+- fixed another best package choice to avoid choosing package too
+ early.
+- fixed pre-required files not correctly fetched in provides when
+ parsing synthesis file.
+- fixed bad behaviour of unresolved_provides_clean.
+
* Wed Jul 24 2002 François Pons <fpons@mandrakesoft.com> 0.50-3mdk
- fixed typo causing difference of provides to be not examined.
- fixed best package as choice to avoid choosing package too early.