diff options
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | po/fr.po | 2 | ||||
-rwxr-xr-x | urpmi | 26 | ||||
-rwxr-xr-x | urpmi.addmedia | 5 |
4 files changed, 27 insertions, 11 deletions
@@ -7,7 +7,7 @@ URPMIDIR = $(PREFIX)/etc/urpmi LOCALEDIR = $(PREFIX)/usr/share/locale -.PHONY: install +.PHONY: install clean install: autoirpm.update-all $(MAKE) -C po $@ @@ -25,6 +25,9 @@ install: autoirpm.update-all autoirpm.update-all: %: %.cc $(CXX) -I/usr/include/rpm -g $< -lrpm -ldb1 -lz -o $@ +tar: clean + cd .. ; tar cfy urpmi.tar.bz2 urpmi + po: $(MAKE) -C $@ @@ -27,7 +27,7 @@ msgstr "Les paquetages suivants contiennent %s: %s\n" #: ../urpmi:71 msgid "rpm database query failed\n" -msgstr "la requête sur la base de données rpm a échouée\n" +msgstr "la requête sur la base de données rpm a échoué\n" #: ../urpmi:80 #, fuzzy @@ -1,7 +1,6 @@ #!/usr/bin/perl -U -my $lang = $ENV{LC_ALL} || $ENV{LANGUAGE} || $ENV{LC_MESSAGES} || $ENV{LANG}; -load_po(substr($lang, 0, 2)); +load_po(); $ENV{PATH} = "/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"; $< = $>; @@ -41,7 +40,8 @@ select STDOUT; $| = 1; # make unbuffered open F, $depsfile or die(); foreach (<F>) { - my ($pack, $deps) = /(\S+)\s+\S+\s+(.*)/ or die("urpmi: bad format file $depsfile\n"); + my ($pack, $size, $deps) = /(\S+)\s+(\S+)\s+(.*)/ or die("urpmi: bad format file $depsfile\n"); + $size{$pack} = $size; $deps{$pack} = [ split ' ', $deps ]; foreach $v (@ARGV) { @@ -77,7 +77,8 @@ foreach (@installed) { my %to_install; closure_deps(\%to_install, @packages); @to_install = keys %to_install; if (!$auto and difference2(\@to_install, \@packages)) { - my $msg = _("To satisfy dependencies, the following packages are going to be installed"); + my $sum = 0; map { $sum += $size{$_} } @to_install; + my $msg = _("To satisfy dependencies, the following packages are going to be installed (%d MB)", toMb($sum)); my $msg2 = _("Is it ok?"); if ($X) { my $p = join "\n", @to_install; @@ -107,7 +108,11 @@ foreach $l (@to_install) { $removables{$n}->{device} = $1; push @{$removables{$n}->{list}}, $_; } else { - s|^file:/||; + if (s|^file:/||) { + if (|^(/mnt/.*?)/|) { + -e $_ || $try2mount{$1} or $try2mount{$1} = 1, `mount $1 2>/dev/null`; + } + } push @to_install_long, $_; } } @@ -207,7 +212,10 @@ sub le_version { return $cmp < 0 || $cmp == 0 && version_compare($_[0][1], $_[1][1]) < 0; } - +sub toMb { + my $nb = $_[0] / 1024 / 1024; + int $nb + 0.5; +} sub message { $X ? `gmessage -default Ok -buttons Ok "$_[0]"` : print SAVEOUT "$_[0]\n"; } sub member($@) { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 } @@ -227,7 +235,11 @@ sub untaint { sub load_po { my ($from, $to, $state, $fuzzy); - local *F; open F, "/usr/share/locale/$_[0]/LC_MESSAGES/urpmi.po" or return; + + my $lang = $ENV{LANGUAGE} || $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG}; + my $f; -e ($f = "/usr/share/locale/$_/LC_MESSAGES/urpmi.po") and last foreach split ':', $lang; + + local *F; open F, $f or return; foreach (<F>) { /^msgstr/ and $state = 1; /^msgid/ && !$fuzzy and $state = 2; diff --git a/urpmi.addmedia b/urpmi.addmedia index 95f85adf..ec941731 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -21,7 +21,7 @@ if ($0 =~ /removemedia/) { local ($_) = @ARGV or die "missing the entry to remove\n(one of " . join(", ", @entries) . ")\n"; foreach $e (/^--?a/ ? @entries : @ARGV) { my $f; - $f = "$DIR/hdlist.$e"; unlink $f or die "failed to remove $f"; + $f = "$DIR/hdlist.$e"; unlink $f || unlink "$f.gz" or die "failed to remove $f"; $f = "$DIR/list.$e"; unlink $f or die "failed to remove $f"; substInFile { s/^/\#/ if /^$e\s/ } $CFG; } @@ -34,7 +34,8 @@ if ($0 =~ /removemedia/) { } if (glob("$DIR/hdlist.*")) { print "generating dependencies list\n"; - system("gendepslist -h $DEPSLIST $DIR/hdlist.*"); + system("gzip $DIR/hdlist.* 2>/dev/null"); # gzip + system("gzip -dc $DIR/hdlist.* | gendepslist -h $DEPSLIST -"); system("autoirpm.update"); } else { unlink $DEPSLIST, "$DEPSLIST.html"; |