summaryrefslogtreecommitdiffstats
path: root/po/wa.po
diff options
context:
space:
mode:
Diffstat (limited to 'po/wa.po')
-rw-r--r--po/wa.po52
1 files changed, 25 insertions, 27 deletions
diff --git a/po/wa.po b/po/wa.po
index 7682fd09..0ecb361e 100644
--- a/po/wa.po
+++ b/po/wa.po
@@ -11,7 +11,7 @@
msgid ""
msgstr ""
"Project-Id-Version: urpmi 3.3\n"
-"POT-Creation-Date: 2003-08-30 13:34+0200\n"
+"POT-Creation-Date: 2003-09-04 20:39+0200\n"
"PO-Revision-Date: 2003-05-13 12:50+0200\n"
"Last-Translator: Lorint Hendschel <LorintHendschel@skynet.be>\n"
"Language-Team: Walon <linux-wa@chanae.alphanet.ch>\n"
@@ -432,11 +432,6 @@ msgstr ""
msgid " --list-nodes - list available nodes when using --parallel.\n"
msgstr " --list-nodes - djivêye des nuks k' i gn a (eployant --parallel).\n"
-#: ../urpm.pm:1
-#, c-format
-msgid "building hdlist [%s]"
-msgstr "dji fwai l' fitchî hdlist [%s]"
-
#: ../urpmi:1 ../urpmq:1
#, c-format
msgid ""
@@ -448,6 +443,11 @@ msgstr ""
#: ../urpm.pm:1
#, c-format
+msgid "building hdlist [%s]"
+msgstr "dji fwai l' fitchî hdlist [%s]"
+
+#: ../urpm.pm:1
+#, c-format
msgid "examining MD5SUM file"
msgstr "corwaitaedje do fitchî MD5SUM"
@@ -629,7 +629,7 @@ msgstr ""
msgid " -a - select all media.\n"
msgstr " -a - tchoezi tos les sopoirts.\n"
-#: ../urpmi:1
+#: ../urpm.pm:1
#, c-format
msgid "Missing signature (%s)"
msgstr "I manke li sinateure (%s)"
@@ -690,14 +690,6 @@ msgstr ""
msgid "Installing package `%s' (%s/%s)..."
msgstr "Dj' astale li pacaedje «%s» (%s/%s)..."
-#: ../urpmi.update:1
-#, c-format
-msgid ""
-" -d - force complete computation of depslist.ordered file.\n"
-msgstr ""
-" -d - foirci li carculaedje d' on novea fitchî «depslist."
-"ordered».\n"
-
#: ../urpm.pm:1
#, c-format
msgid "no entries relocated in depslist"
@@ -746,6 +738,11 @@ msgstr ""
msgid "skipping package %s"
msgstr "dji passe houte do pacaedje %s"
+#: ../urpm.pm:1
+#, c-format
+msgid "Invalid signature (%s)"
+msgstr "Sinateure nén valide (%s)"
+
#: ../urpmq:1
#, c-format
msgid " names or rpm files given on command line are queried.\n"
@@ -753,11 +750,6 @@ msgstr " les nos ou fitchîs rpm dinés sol roye di comande sont rcwerous.\n"
#: ../urpmi:1
#, c-format
-msgid "Invalid signature (%s)"
-msgstr "Sinateure nén valide (%s)"
-
-#: ../urpmi:1
-#, c-format
msgid ""
"urpmi version %s\n"
"Copyright (C) 1999, 2000, 2001, 2002 MandrakeSoft.\n"
@@ -806,11 +798,6 @@ msgstr "dji n' sai analijhî li fitchî hdlist di «%s»"
msgid "due to conflicts with %s"
msgstr "cåze di conflits avou %s"
-#: ../urpm.pm:1
-#, c-format
-msgid "removing %d obsolete headers in cache"
-msgstr "dji bodje %d viyès tiestires del muchete"
-
#: ../urpmi.addmedia:1
#, c-format
msgid "unable to update medium \"%s\"\n"
@@ -823,6 +810,11 @@ msgstr "Sayî d' astaler sin verifyî les aloyaedjes? (o/N) "
#: ../urpm.pm:1
#, c-format
+msgid "removing %d obsolete headers in cache"
+msgstr "dji bodje %d viyès tiestires del muchete"
+
+#: ../urpm.pm:1
+#, c-format
msgid "virtual medium \"%s\" is not local, medium ignored"
msgstr "li forveyou sopoirt «%s» n' est nén locå, dji passe houte do sopoirt"
@@ -1038,7 +1030,7 @@ msgid " -a - select all packages matching expression.\n"
msgstr ""
" -a - tchoezi tos les pacaedjes ki corespondèt al ratourneure.\n"
-#: ../urpmi:1
+#: ../urpm.pm:1
#, c-format
msgid "Invalid Key ID (%s)"
msgstr "ID di clé nén valide (%s)"
@@ -1109,7 +1101,7 @@ msgstr "Voloz vs continuwer avou l' astalaedje?"
msgid "unable to read rpm file [%s] from medium \"%s\""
msgstr "dji n' sai lere li fitchî rpm [%s] foû do sopoirt «%s»"
-#: ../urpm.pm:1
+#: ../urpm.pm:1 ../urpmi:1
#, c-format
msgid "built hdlist synthesis file for medium \"%s\""
msgstr "dji fwai li fitchî di sinteze hdlist pol sopoirt «%s»"
@@ -1947,6 +1939,12 @@ msgstr ""
"fén.\n"
#~ msgid ""
+#~ " -d - force complete computation of depslist.ordered file.\n"
+#~ msgstr ""
+#~ " -d - foirci li carculaedje d' on novea fitchî «depslist."
+#~ "ordered».\n"
+
+#~ msgid ""
#~ " --name - print tag name: rpm filename (assumed if no tag given "
#~ "on\n"
#~ " command line but without package name).\n"
#n221'>221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
package raid; # $Id$

use diagnostics;
use strict;

#-######################################################################################
#- misc imports
#-######################################################################################
use common;
use fs::type;
use fs::get;
use run_program;
use devices;
use modules;

sub max_nb() { 31 }

sub check_prog {
    my ($in) = @_;
    $::prefix ? whereis_binary('mdadm') : $in->do_pkgs->ensure_binary_is_installed('mdadm', 'mdadm');
}

sub new {
    my ($raids, %opts) = @_;
    my $md_part = { %opts };
    add2hash_($md_part, { 'chunk-size' => '64', disks => [], 
			  fs_type => 'ext3',
			  device => first(free_mds($raids)), 
			  notFormatted => 1, level => 1 });
    push @$raids, $md_part;
    foreach (@{$md_part->{disks}}) {
	$_->{raid} = $md_part->{device};
	fs::type::set_pt_type($_, 0xfd);
	delete $_->{mntpoint};
    }
    update($md_part);
    $md_part;
}

sub add {
    my ($md_part, $part) = @_;
    $md_part->{isMounted} and die N("Can not add a partition to _formatted_ RAID %s", $md_part->{device});
    inactivate_and_dirty($md_part);
    set_isFormatted($part, 0);
    $part->{raid} = $md_part->{device};
    delete $part->{mntpoint};
    push @{$md_part->{disks}}, $part;
    update($md_part);
}

sub delete {
    my ($raids, $md_part) = @_;
    inactivate_and_dirty($md_part);
    delete $_->{raid} foreach @{$md_part->{disks}};
    @$raids = grep { $_ != $md_part } @$raids;
    write_conf($raids) if $::isStandalone;
}

sub change_device {
    my ($md_part, $new_device) = @_;
    if ($new_device ne $md_part->{device}) {
	inactivate_and_dirty($md_part);
	$md_part->{device} = $new_device;
	$_->{raid} = $new_device foreach @{$md_part->{disks}};
    }
}

sub removeDisk {
    my ($raids, $part) = @_;
    my $md_part = fs::get::device2part($part->{raid}, $raids);
    inactivate_and_dirty($md_part);
    fs::type::set_isFormatted($part, 0);
    delete $part->{raid};
    my $disks = $md_part->{disks};
    @$disks = grep { $_ != $part } @$disks;
    if (@$disks) {
	update($md_part);
    } else {
	@$raids = grep { $_ != $md_part } @$raids;
    }
    write_conf($raids) if $::isStandalone;
}

sub updateSize {
    my ($part) = @_;
    local $_ = $part->{level};
    my @l = map { $_->{size} } @{$part->{disks}};

    $part->{size} = do {
	if (/0|linear/) { sum @l }
	elsif (/1/)     { min @l }
	elsif (/4|5/)   { min(@l) * (@l - 1) }
	elsif (/6/)     { min(@l) * (@l - 2) }
    };
}

sub allmodules {
    [ 'raid0', 'raid1', 'raid10', 'raid456' ];
}

sub module {
    my ($part) = @_;
    my $level = $part->{level};
    log::l("level $level");

    if (member($level, 4, 5, 6)) {
	'raid456';
    } elsif ($level =~ /^\d+$/) {
	"raid$level";
    } else {
	$level;
    }
}


sub update {
    updateSize($_) foreach @_;
}

sub make {
    my ($raids, $part) = @_;    

    return if is_active($part->{device});

    inactivate_and_dirty($part);

    isRAID($_) and make($raids, $_) foreach @{$part->{disks}};
    eval { modules::load(module($part)) };

    whereis_binary('mdadm') or die 'mdadm not installed';

    my $dev = devices::make($part->{device});
    my $nb = @{$part->{disks}};

    run_program::run_or_die('mdadm', '--create', '--run', $dev, 
			    if_($nb == 1, '--force'),
			    '--chunk=' . $part->{'chunk-size'}, 
			    "--level=$part->{level}", 
			    "--raid-devices=$nb",
			    map { devices::make($_->{device}) } @{$part->{disks}});

    if (my $raw_part = get_md_info($dev)) {
	$part->{UUID} = $raw_part->{UUID};
    }
    write_conf($raids) if $::isStandalone;
}

sub format_part {
    my ($raids, $part) = @_;
    $part->{isFormatted} and return;

    make($raids, $part);
    fs::format::part_raw($part, undef);
    set_isFormatted($_, 1) foreach @{$part->{disks}};
}

sub verify {
    my ($raids) = @_;
    foreach (@$raids) {
	my $nb = $_->{level} =~ /6/ ? 4 : $_->{level} =~ /4|5/ ? 3 : 2;
	@{$_->{disks}} >= $nb or die N("Not enough partitions for RAID level %d\n", $_->{level});
    }
}

sub inactivate_and_dirty {
    my ($part) = @_;
    run_program::run('mdadm', '--stop', devices::make($part->{device}));
    set_isFormatted($part, 0);
}

sub active_mds() {
    map { if_(/^(md\S+)\s*:\s*active/, $1) } cat_("/proc/mdstat");
}
sub inactive_mds() {
    map { if_(/^(md\S+)\s*:\s*inactive/, $1) } cat_("/proc/mdstat");
}

sub free_mds {
    my ($raids) = @_;
    difference2([ map { "md$_" } 0 .. max_nb() ], [ map { $_->{device} } @$raids ]);
}

sub detect_during_install {
    my (@parts) = @_;
    detect_during_install_once(@parts);
    detect_during_install_once(@parts) if active_mds(); #- try again to detect RAID 10

    foreach (inactive_mds()) {
	log::l("$_ is an inactive md, we stop it to ensure it doesn't busy devices");
	run_program::run('mdadm', '--stop', devices::make($_));
    }
}

sub detect_during_install_once {
    my (@parts) = @_;
    devices::make("md$_") foreach 0 .. max_nb();
    output('/etc/mdadm.conf', join(' ', 'DEVICE', 
				   (map { "/dev/$_" } active_mds()), 
				   map { devices::make($_->{device}) } @parts), "\n");
    run_program::run('mdadm', '>>', '/etc/mdadm.conf', '--examine', '--scan');

    foreach (@{allmodules()}) {
	eval { modules::load(module($_)) };
    }
    run_program::run('mdadm', '--assemble', '--scan');    
}

sub get_existing {
    my @parts = @_;
    my $raids = [];
    foreach my $md (active_mds()) {
	my $raw_part = get_md_info(devices::make($md)) or next;

	$raw_part->{level} =~ s/raid//; #- { linear | raid0 | raid1 | raid5 | raid6 } -> { linear | 0 | 1 | 5 | 6 }

	my @mdparts = 
	  map { 
	      if (my $part = fs::get::device2part($_, [ @parts, @$raids ])) {
		  $part;
	      } else {
		  log::l("ERROR: unknown raw raid device $_");
		  ();
	      }
	  } split(',', $raw_part->{devices});

	my $md_part = new($raids, device => $md, UUID => $raw_part->{UUID}, level => $raw_part->{level}, disks => \@mdparts);

	my $type = fs::type::type_subpart_from_magic($md_part);
	if ($type) {
	    put_in_hash($md_part, $type);
	} else {
	    fs::type::set_fs_type($md_part, 'ext3');
	}
	my $fs_type = $type && $type->{fs_type};
	fs::type::set_isFormatted($md_part, to_bool($fs_type));

	log::l("RAID: found $md (raid $md_part->{level}) type $fs_type with parts $raw_part->{devices}");
    }
    $raids;
}

sub is_active {
    my ($dev) = @_;
    member($dev, active_mds());
}

sub write_conf {
    my ($raids) = @_;

    @$raids or return;

    my @devices = uniq(map { devices::make($_->{device}) } map { @{$_->{disks}} } @$raids);

    output($::isInstall ? "$::prefix/etc/mdadm.conf" : "/etc/mdadm.conf",
	   join(' ', 'DEVICE', @devices) . "\n",
	   map { "ARRAY " . devices::make($_->{device}) . " UUID=$_->{UUID} auto=yes\n" } @$raids);
}

sub get_md_info {
    my ($dev) = @_;
    my $conf = parse_mdadm_conf(scalar run_program::get_stdout('mdadm', '--detail', '--brief', '-v', $dev));

    @{$conf->{ARRAY}} or return;