summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-30 14:11:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-30 14:11:44 +0000
commitd96d4fdd97391a14328a96057cec2acc00bafa2d (patch)
tree1eb90d8bbe821efea49f6fa1a9a2abe63649c826
parent8af43471691c924a8c633a1cc553b86819b47369 (diff)
downloaddrakx-backup-do-not-use-d96d4fdd97391a14328a96057cec2acc00bafa2d.tar
drakx-backup-do-not-use-d96d4fdd97391a14328a96057cec2acc00bafa2d.tar.gz
drakx-backup-do-not-use-d96d4fdd97391a14328a96057cec2acc00bafa2d.tar.bz2
drakx-backup-do-not-use-d96d4fdd97391a14328a96057cec2acc00bafa2d.tar.xz
drakx-backup-do-not-use-d96d4fdd97391a14328a96057cec2acc00bafa2d.zip
create common::parse_release_file() out of find_root_parts()
-rw-r--r--perl-install/common.pm8
-rw-r--r--perl-install/install/any.pm12
2 files changed, 10 insertions, 10 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index dfa9f139e..5daf17af0 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -294,6 +294,14 @@ sub set_permissions {
chmod(oct($perms), $file) or die "chmod of file $file failed: $!\n";
}
+sub parse_release_file {
+ my ($prefix, $f, $part) = @_;
+ chomp(my $s = cat_("$prefix$f"));
+ my $arch = $s =~ s/\s+for\s+(\S+)// && $1;
+ log::l("find_root_parts found $part->{device}: $s for $arch" . ($f !~ m!/etc/! ? " in special release file $f" : ''));
+ { release => $s, release_file => $f, part => $part, arch => $arch };
+}
+
sub release_file {
my ($o_dir) = @_;
my @names = ('mandrakelinux-release', 'mandrake-release', 'conectiva-release', 'release', 'redhat-release', 'fedora-release');
diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm
index 4f01bff3b..94264d19c 100644
--- a/perl-install/install/any.pm
+++ b/perl-install/install/any.pm
@@ -967,23 +967,15 @@ sub generate_automatic_stage1_params {
sub find_root_parts {
my ($fstab, $prefix) = @_;
- my $extract = sub {
- my ($prefix, $f, $part) = @_;
- chomp(my $s = cat_("$prefix$f"));
- my $arch = $s =~ s/\s+for\s+(\S+)// && $1;
- log::l("find_root_parts found $part->{device}: $s for $arch" . ($f !~ m!/etc/! ? " in special release file $f" : ''));
- { release => $s, release_file => $f, part => $part, arch => $arch };
- };
-
if ($::local_install) {
my $f = common::release_file('/mnt') or return;
- return $extract->('/mnt', $f, {});
+ return common::parse_release_file('/mnt', $f, {});
}
map {
my $handle = any::inspect($_, $prefix);
if (my $f = $handle && common::release_file($handle->{dir})) {
- $extract->($handle->{dir}, $f, $_);
+ common::parse_release_file($handle->{dir}, $f, $_);
} else { () }
} grep { isTrueLocalFS($_) } @$fstab;
}