From 95625f03125103808e0ba3591a632350b7d23a87 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 23 May 2012 18:26:44 +0000 Subject: (read_product_id) split it out of main() --- perl-install/install/install2.pm | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'perl-install') diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm index 43086895c..b58cba988 100644 --- a/perl-install/install/install2.pm +++ b/perl-install/install/install2.pm @@ -341,6 +341,18 @@ sub init_brltty() { run_program::run("brltty"); } +sub read_product_id() { + my $product_id = cat__(install::any::getFile_($o->{stage2_phys_medium}, "product.id")); + log::l('product_id: ' . chomp_($product_id)); + $o->{product_id} = common::parse_LDAP_namespace_structure($product_id); + + $o->{meta_class} ||= { + One => 'desktop', + Free => 'download', + Powerpack => 'powerpack', + }->{$o->{product_id}{product}} || 'download'; +} + sub sig_segv_handler() { my $msg = "segmentation fault: install crashed (maybe memory is missing?)\n" . backtrace(); log::l("$msg\n"); @@ -585,17 +597,7 @@ sub main { $o->{allowFB} = listlength(cat_("/proc/fb")); - if (!$::testing) { - my $product_id = cat__(install::any::getFile_($o->{stage2_phys_medium}, "product.id")); - log::l('product_id: ' . chomp_($product_id)); - $o->{product_id} = common::parse_LDAP_namespace_structure($product_id); - - $o->{meta_class} ||= { - One => 'desktop', - Free => 'download', - Powerpack => 'powerpack', - }->{$o->{product_id}{product}} || 'download'; - } + read_product_id() if !$::testing; log::l("META_CLASS=$o->{meta_class}"); $ENV{META_CLASS} = $o->{meta_class}; #- for Ia Ora -- cgit v1.2.1