From: Joachim Breitner Date: Fri, 24 Jul 2009 12:57:35 +0000 (+0200) Subject: Create valid dctrl-like output X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=549bb8a5e8afab4da77f91651ca947b71f69d1dc;p=wannabuild.git Create valid dctrl-like output Instead of adding the dots for empty lines when reading the input, and adding the extra space when outputting, save the data as is and create the correct format when outputting. This makes sure that multi-line-data passed to -m is also represented correctly. --- diff --git a/bin/wanna-build b/bin/wanna-build index 4f3690c..c093a7f 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -274,7 +274,6 @@ if (!$fail_reason) { while(!eof(STDIN)) { $line = ; last if $line eq ".\n"; - $line = ".\n" if $line eq "\n"; $fail_reason .= $line; } chomp( $fail_reason ); @@ -2187,8 +2186,8 @@ sub write_db { if (!defined($ui->{'User'})); foreach $key (keys %{$ui}) { my $val = $ui->{$key}; - chomp($val); - $val =~ s/\n/\n /g; + $val =~ s/^/ /mg; + $val =~ s/^ $/ ./mg; print F "$key: $val\n"; } print F "\n"; @@ -2198,7 +2197,8 @@ sub write_db { foreach $key (keys %{$pkg}) { my $val = $pkg->{$key}; chomp( $val ); - $val =~ s/\n/\n /g; + $val =~ s/^/ /mg; + $val =~ s/^ $/ ./mg; print F "$key: $val\n"; } print F "\n";