From 549bb8a5e8afab4da77f91651ca947b71f69d1dc Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Fri, 24 Jul 2009 14:57:35 +0200 Subject: [PATCH] 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. --- bin/wanna-build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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"; -- 2.39.5