aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS44
-rw-r--r--URPM/Build.pm19
-rw-r--r--URPM/Resolve.pm17
3 files changed, 66 insertions, 14 deletions
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..f0bc984
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,44 @@
+Version 1.60 - 8 March 2007, by Pascal "Pixel" Rigaux
+
+- more debugging hooks
+- create $urpm->packages_providing($name) and use it
+- create $urpm->packages_by_name($name)
+
+Version 1.59 - 1 March 2007, by Olivier Thauvin
+
+- rpm 4.4.8 adaptions
+- load rpm config files at module load, improve the mechanism
+
+Version 1.58 - 14 February 2007, by Pascal "Pixel" Rigaux
+
+- don't check signature and digest in ->traverse and ->traverse_tag
+ (=> x15 speedup, ie 2.5 speedup on urpmi --auto-select and rpmdrake)
+
+Version 1.57 - 9 February 2007, by Pascal "Pixel" Rigaux
+
+- allow upgrading from noarch to x86_64 even if strict-arch
+
+Version 1.56 - 19 January 2007, by Pascal "Pixel" Rigaux
+
+- tell perl that strings from rpm headers are utf8
+- add URPM::bind_rpm_textdomain_codeset() to set encoding of messages returned
+ by rpmlib, and tell perl that those strings are utf8
+- really use strict-arch by default on x86_64
+
+Version 1.55 - 10 January 2007, by Pascal "Pixel" Rigaux
+
+- bug fix release
+- fix "not selecting foo-1 since the more recent foo-1 is installed" causing
+ urpmi to try to remove the package it wants to install (#28076)
+
+Version 1.54 - 9 January 2007, by Pascal "Pixel" Rigaux
+
+- if we have a choice between foo-1 and bar-1 and foo-2 is installed,
+ prefering bar-1 instead of foo-1
+ (otherwise we can hit: "the more recent foo-2 is installed, but does not
+ provide xxx whereas foo-1 does", cf bug #27991)
+- bar is needed, foo-1 does provide bar, installed foo-2 does not provide bar:
+ do not let the algorithm use foo-2 as if it also provides bar
+- allow understanding what ->resolve_requested is doing through a callback ($urpm->{debug_URPM})
+- cleanup some code in ->resolve_requested
+- make the documentation for ->is_arch_compat more clear
diff --git a/URPM/Build.pm b/URPM/Build.pm
index 924074a..66de723 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -17,6 +17,7 @@ sub _get_tmp_dir () {
#- dir : directory which will contain headers (defaults to /tmp/.build_hdlist)
#- callback : perl code to be called for each package read (defaults pack_header)
#- clean : bool to clean cache before (default no).
+#- packing : bool to create info (default is weird)
sub parse_rpms_build_headers {
my ($urpm, %options) = @_;
my ($dir, %cache, @headers);
@@ -24,7 +25,7 @@ sub parse_rpms_build_headers {
#- check for mandatory options.
if (@{$options{rpms} || []} > 0) {
#- build a working directory which will hold rpm headers.
- $dir = $options{dir} || _get_tmp_dir;
+ $dir = $options{dir} || _get_tmp_dir();
$options{clean} and system($ENV{LD_LOADER} ? $ENV{LD_LOADER} : @{[]}, "rm", "-rf", $dir);
-d $dir or mkdir $dir, 0755 or die "cannot create directory $dir\n";
@@ -46,11 +47,11 @@ sub parse_rpms_build_headers {
}
foreach (@{$options{rpms}}) {
- my ($key) = /([^\/]*)\.rpm$/ or next; #- get rpm filename.
+ my ($key) = m!([^/]*)\.rpm$! or next; #- get rpm filename.
my ($id, $filename);
if ($cache{$key} && $cache{$key}{time} > 0 && $cache{$key}{time} >= (stat $_)[9]) {
- ($id, undef) = $urpm->parse_hdlist("$dir/$cache{$key}{file}", keep_all_tags => $options{keep_all_tags});
+ ($id, undef) = $urpm->parse_hdlist("$dir/$cache{$key}{file}", packing => $options{packing}, keep_all_tags => $options{keep_all_tags});
unless (defined $id) {
if ($options{dontdie}) {
print STDERR "bad header $dir/$cache{$key}{file}\n";
@@ -124,13 +125,13 @@ sub parse_headers {
my ($urpm, %options) = @_;
my ($dir, $start, $id);
- $dir = $options{dir} || _get_tmp_dir;
+ $dir = $options{dir} || _get_tmp_dir();
-d $dir or die "no directory $dir\n";
$start = @{$urpm->{depslist} || []};
foreach (@{$options{headers} || []}) {
#- make smart use of memory (no need to keep header in memory now).
- ($id, undef) = $urpm->parse_hdlist("$dir/$_", !$options{callback});
+ ($id, undef) = $urpm->parse_hdlist("$dir/$_", packing => !$options{callback});
defined $id or die "bad header $dir/$_\n";
$options{callback} and $options{callback}->($urpm, $id, %options);
}
@@ -404,10 +405,10 @@ sub build_hdlist {
my ($urpm, %options) = @_;
my ($dir, $ratio, @idlist);
- $dir = $options{dir} || _get_tmp_dir;
+ $dir = $options{dir} || _get_tmp_dir();
-d $dir or die "no directory $dir\n";
- @idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist}) or return;
+ @idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist});
#- compression ratio are not very high, sample for cooker
#- gives the following (main only and cache fed up):
@@ -429,7 +430,7 @@ sub build_hdlist {
) or die "Can't create archive";
foreach my $pkg (@{$urpm->{depslist}}[@idlist]) {
my $filename = $pkg->fullname;
- "$filename.rpm" ne $pkg->filename && $pkg->filename =~ /([^\/]*)\.rpm$/
+ "$filename.rpm" ne $pkg->filename && $pkg->filename =~ m!([^/]*)\.rpm$!
and $filename .= ":$1";
-s "$dir/$filename" or die "bad header $dir/$filename\n";
$pack->add($dir, $filename);
@@ -448,7 +449,7 @@ sub build_synthesis {
my ($urpm, %options) = @_;
my ($ratio, @idlist);
- @idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist}) or return;
+ @idlist = $urpm->build_listid($options{start}, $options{end}, $options{idlist});
$ratio = $options{ratio} || 9;
$options{synthesis} || defined $options{fd} or die "invalid parameters given";
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index cb458a4..7aeb0d1 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -714,11 +714,18 @@ sub resolve_requested {
push @keep, scalar $p->fullname;
} else {
#- no package has been found, we need to remove the package examined.
- delete $state->{rejected}{$p->fullname}; #- force resolution (#12696, maybe #11885)
- $urpm->resolve_rejected($db, $state, $p,
- removed => 1, unsatisfied => \@properties,
- from => scalar $pkg->fullname,
- why => { conflicts => scalar $pkg->fullname });
+ my $obsoleted;
+ #- force resolution (#12696, maybe #11885)
+ if (my $prev = delete $state->{rejected}{$p->fullname}) {
+ $obsoleted = $prev->{obsoleted};
+ }
+ $urpm->resolve_rejected(
+ $db, $state, $p,
+ ($obsoleted ? 'obsoleted' : 'removed') => 1,
+ unsatisfied => \@properties,
+ from => scalar $pkg->fullname,
+ why => { conflicts => scalar $pkg->fullname },
+ );
}
}
}