From c24f9dfdd1534e69a9feedd1460c2f45970515eb Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 9 Jul 2002 22:48:04 +0000 Subject: move join_lines to common --- perl-install/common.pm | 14 ++++++++++++++ perl-install/modparm.pm | 17 +---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/perl-install/common.pm b/perl-install/common.pm index f39cda588..a673dce04 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -166,6 +166,20 @@ sub take_screenshot { $in->ask_warn('', _("Screenshots will be available after install in %s", "/root/DrakX-screenshots")) if $warn; } +sub join_lines { + my @l; + my $s; + foreach (@_) { + if (/^\s/) { + $s .= $_; + } else { + push @l, $s if $s; + $s = $_; + } + } + @l, if_($s, $s); +} + #-###################################################################################### #- Wonderful perl :( #-###################################################################################### diff --git a/perl-install/modparm.pm b/perl-install/modparm.pm index 849cc40a1..ee5fd46ab 100644 --- a/perl-install/modparm.pm +++ b/perl-install/modparm.pm @@ -23,7 +23,7 @@ sub parameters { } my @parameters; - foreach (join_lines(`$modinfo -p $module`)) { + foreach (common::join_lines(`$modinfo -p $module`)) { chomp; next if /^warning:/; (my $name, $_) = /(\S+)\s+(.*)/s or warn "modparm::get_options_name($module): unknown line\n"; @@ -60,19 +60,4 @@ sub parameters { @parameters; } - -sub join_lines { - my @l; - my $s; - foreach (@_) { - if (/^\s/) { - $s .= $_; - } else { - push @l, $s if $s; - $s = $_; - } - } - @l, if_($s, $s); -} - 1; -- cgit v1.2.1