summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-10-20 23:03:06 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-10-20 23:03:06 +0000
commita87392ce672688850dc174df6a39c7fe745175fa (patch)
treee6031e42126b35e7c5aef402cf3065263d422868 /perl-install/common.pm
parent7fe5f8b71356459a6062df5fca0236a502165b8c (diff)
downloaddrakx-a87392ce672688850dc174df6a39c7fe745175fa.tar
drakx-a87392ce672688850dc174df6a39c7fe745175fa.tar.gz
drakx-a87392ce672688850dc174df6a39c7fe745175fa.tar.bz2
drakx-a87392ce672688850dc174df6a39c7fe745175fa.tar.xz
drakx-a87392ce672688850dc174df6a39c7fe745175fa.zip
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm18
1 files changed, 17 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 481ce793f..aab938f2f 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- common => [ qw(__ even odd min max sqr sum sign product bool invbool listlength bool2text text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX) ],
+ common => [ qw(__ even odd min max sqr sum sign product bool invbool listlength bool2text text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines) ],
functional => [ qw(fold_left compose map_index grep_index map_each grep_each map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie) ],
file => [ qw(dirname basename touch all glob_ cat_ symlinkf chop_ mode typeFromMagic) ],
system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ crypt_ getVarsFromSh setVarsInSh) ],
@@ -282,6 +282,22 @@ sub formatAlaTeX($) {
$t . ($t && $tmp && "\n") . $tmp;
}
+sub formatLines($) {
+ my ($t, $tmp);
+ foreach (split "\n", $_[0]) {
+ if (/^$/) {
+ $t .= "$tmp\n";
+ $tmp = "";
+ } elsif (/^\s/) {
+ $t .= "$tmp\n";
+ $tmp = $_;
+ } else {
+ $tmp = ($tmp ? "$tmp " : ($t && "\n") . $tmp) . $_;
+ }
+ }
+ "$t$tmp\n";
+}
+
sub getVarsFromSh($) {
my %l;
local *F;