From ac8f1e53ea18a65ad30ab112f61fd34d97051372 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Fri, 19 Jul 2002 09:22:02 +0000 Subject: 3.8-1mdk --- urpm.pm | 14 +++++++++++--- urpmi | 6 +++--- urpmi.spec | 11 ++++++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/urpm.pm b/urpm.pm index f8473bd0..0569ebb5 100644 --- a/urpm.pm +++ b/urpm.pm @@ -3,7 +3,7 @@ package urpm; use strict; use vars qw($VERSION @ISA); -$VERSION = '3.7'; +$VERSION = '3.8'; @ISA = qw(URPM); =head1 NAME @@ -1796,7 +1796,12 @@ sub install_logger { if ($subtype eq 'start') { $urpm->{logger_progress} = 0; - printf "%-28s", $type eq 'trans' ? _("Preparing...") : ($pkg && $pkg->name); + if ($type eq 'trans') { + $urpm->{logger_id} = 0; + printf "%-28s", _("Preparing..."); + } else { + printf "%4d:%-23s", ++$urpm->{logger_id}, ($pkg && $pkg->name); + } } elsif ($subtype eq 'stop') { if ($urpm->{logger_progress} < $progress_size) { print '#' x ($progress_size - $urpm->{logger_progress}); @@ -1816,12 +1821,15 @@ sub install_logger { #- install packages according to each hashes (install or upgrade). sub install { - my ($urpm, $prefix, $install, $upgrade, %options) = @_; + my ($urpm, $prefix, $remove, $install, $upgrade, %options) = @_; my $db = URPM::DB::open($prefix, 1); #- open in read/write mode. my $trans = $db->create_transaction($prefix); my @l; local *F; + foreach (@$remove) { + $trans->remove($_) or $urpm->{error}(_("unable to remove package %s", $_)); + } foreach (keys %$install) { my $pkg = $urpm->{depslist}[$_]; $pkg->update_header($install->{$_}); diff --git a/urpmi b/urpmi index ecb35cf9..696fd1d9 100755 --- a/urpmi +++ b/urpmi @@ -370,8 +370,7 @@ if (%{$state->{ask_remove} || {}}) { my $list = join "\n", keys %{$state->{ask_remove}}; $noexpr = _("Nn"); $yesexpr = _("Yy"); - message_input(_("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ or - system("rpm", "-e", "--nodeps", keys %{$state->{ask_remove}}, ($root ? ("--root", $root) : ())); + message_input(_("The following packages have to be removed for others to be upgraded:\n%s\ndo you agree ?", $list) . _(" (Y/n) ")) =~ /[$noexpr]/ and $state->{ask_remove} = {}; } #- get out of package that should not be upgraded. @@ -467,6 +466,7 @@ if (%sources_install || %sources) { exit 0; } else { if ($X && !$root) { + system("rpm", "-e", "--nodeps", keys %{$state->{ask_remove} || {}}, ($root ? ("--root", $root) : ())); system("grpmi", $WID ? ("--WID=$WID") : (), (map { ("-noupgrade", $_) } values %sources_install), values %sources); if ($?) { @@ -476,7 +476,7 @@ if (%sources_install || %sources) { exit(($? >> 8) + 32); #- forward grpmi error + 32 } } else { - my @l = $urpm->install($root, \%sources_install, \%sources); + my @l = $urpm->install($root, [ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources); if (@l) { message(_("Installation failed") . ":\n" . join("\n", @l)); diff --git a/urpmi.spec b/urpmi.spec index fd0da750..5ff54a88 100644 --- a/urpmi.spec +++ b/urpmi.spec @@ -1,14 +1,14 @@ %define group System/Configuration/Packaging Name: urpmi -Version: 3.7 -Release: 6mdk +Version: 3.8 +Release: 1mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate Summary: User mode rpm install Requires: eject webfetch perl-DateManip >= 5.40 -PreReq: perl-Locale-gettext rpmtools >= 4.3-2mdk perl-URPM >= 0.10-1mdk +PreReq: perl-Locale-gettext rpmtools >= 4.3-2mdk perl-URPM >= 0.11-1mdk BuildRequires: bzip2-devel gcc-c++ gettext rpm-devel rpmtools BuildRoot: %{_tmppath}/%{name}-buildroot BuildArch: noarch @@ -144,6 +144,11 @@ fi %changelog +* Fri Jul 19 2002 François Pons 3.8-1mdk +- removing, installing and upgrading packages is done in only + one transaction. +- changed installation progress to look like rpm one. + * Wed Jul 17 2002 François Pons 3.7-6mdk - fixed uncatched die, now produce error message. -- cgit v1.2.1