From: Chris W. <la...@us...> - 2004-09-27 04:16:16
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3834/lib/OpenInteract2/Config Modified Files: PackageChanges.pm Log Message: OIN-66: fix spacing/display issues when generating Changes file after reading in a previous one; this includes ensuring that empty comments aren't spaced oddly and word-wrapping works properly Index: PackageChanges.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Config/PackageChanges.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PackageChanges.pm 27 Sep 2004 03:35:14 -0000 1.10 --- PackageChanges.pm 27 Sep 2004 04:16:06 -0000 1.11 *************** *** 57,60 **** --- 57,61 ---- LINE: for ( @content ) { + chomp; if ( /^(\d+.\d+)(.*)$/ ) { my $this_version = $1; *************** *** 66,70 **** } $last_entry{version} = $this_version; - chomp $this_date; $this_date =~ s/^\s+//; $this_date =~ s/\s+$//; --- 67,70 ---- *************** *** 80,86 **** } ! # Get rid of leading whitespace in the message... ! s/^\s+//; $last_entry{message} .= $_; } --- 80,87 ---- } ! # Get rid of leading/trailing whitespace in the message... ! s/^\s+/ /; ! s/\s+$/ /; $last_entry{message} .= $_; } *************** *** 89,93 **** push @entries, { %last_entry }; $self->{_entries} = \@entries; ! $self->comments( join( '', @comments ) ); return $self; } --- 90,94 ---- push @entries, { %last_entry }; $self->{_entries} = \@entries; ! $self->comments( join( "\n", @comments ) ); return $self; } *************** *** 137,145 **** || oi_error "Cannot write to '$outfile': $!"; if ( my $comments = $self->comments ) { ! print OUT $comments; } foreach my $entry ( $self->entries ) { ! print OUT $entry->{version}, ' ', $entry->{date}, "\n\n", ! wrap( ' ', ' ', $entry->{message} ), "\n\n"; } } --- 138,150 ---- || oi_error "Cannot write to '$outfile': $!"; if ( my $comments = $self->comments ) { ! print OUT $comments, "\n"; } foreach my $entry ( $self->entries ) { ! print OUT $entry->{version}, ' ', $entry->{date}, "\n\n"; ! if ( $entry->{message} ) { ! my $msg = $entry->{message}; ! $msg =~ s/^\s+//; ! print OUT wrap( ' ', ' ', $msg ), "\n\n"; ! } } } |