From 1c8cd7185dfa0ae62b9194d282a1d39056aba524 Mon Sep 17 00:00:00 2001 From: freesource Date: Sun, 9 Dec 2001 02:35:35 +0000 Subject: [PATCH] This deals with the changelog in a much better fashion. Before grabbing info from STDIN was endlessly buggy, Dch just grabs new info from the Changes file stopping when it finds a paragraph with ^---+* and produces a proper changelog in debian/* . --- gbootroot_pkg | 94 ++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 49 deletions(-) diff --git a/gbootroot_pkg b/gbootroot_pkg index d1fe800..d8f1601 100755 --- a/gbootroot_pkg +++ b/gbootroot_pkg @@ -179,55 +179,6 @@ foreach (@changelog) { } } -# Ask some questions first. -if (!$stop) { - print "\nWrite what you want to be put in the changelog, and I'll\n" . - "prettify everything. End with a newline and .\n"; - print " * "; - my $save_doc; - $save_doc = " * "; - $count = 0; - my $mc = 0; - while () { - my $doc_reply = $_; - if ($doc_reply ne "\n") { - print " "; - $doc_reply = "$doc_reply" if $count != 0 && $mc == 1; - $doc_reply = " $doc_reply" if $count != 0 && $mc != 1; - $mc = 0; - } - else { - print " * "; - if ( $count != 0 && $doc_reply eq "\n" ) { - $mc = 0; - $doc_reply = "\n * "; - $mc++; - } - $doc_reply = "$doc_reply" if $count != 0 && $mc == 1; - $doc_reply = " $doc_reply" if $count != 0 && $mc != 1; - } - last if $doc_reply =~ /^\s*\.\s*$/; - if ($doc_reply) { - $save_doc = $save_doc . $doc_reply; - } - $count++; - - } - - open(CHANGELOG,">$packaging_defaults/changelog") - or die "Couldn't open check: $!\n"; - print CHANGELOG "$prog ($version-$revision) $dist; urgency=$urgency\n\n"; - print CHANGELOG "$save_doc\n"; - print CHANGELOG " -- $name <$email> " . `822-date`; - print CHANGELOG "\n"; - print CHANGELOG @changelog; - close(CHANGELOG); - print "\n"; - -system "chown $real_uid $packaging_defaults/changelog"; -system "chgrp $real_gid $packaging_defaults/changelog"; - -} # end if !$stop # Set-up the copyright open(COPYRIGHT,">$packaging_defaults/copyright") @@ -243,9 +194,52 @@ system "chown $real_uid $packaging_defaults/copyright"; system "chgrp $real_gid $packaging_defaults/copyright"; system "rm $packaging_place/debian/*"; +system "chown $real_uid:$real_gid $packaging_defaults/changelog"; system "cp -fa $packaging_defaults/* $packaging_place/debian"; + chdir($packaging_place); + +# Using dch for the changelog .. very convenient and debian proper. +if (!$stop) { + + $ENV{MAIL} = "freesource@users.sourceforge.net"; + $ENV{DEBFULLNAME} = "Jonathan Rosenbaum"; + + system "chown $real_uid:$real_gid $packaging_place/debian/changelog"; + + $/ = ""; + open(CHANGES, "$gbootroot_cvs/Changes") + or die "Couldn't open $gbootroot_cvs/Changes: $!\n"; + + my $change_watch = 0; + while () { + if (!m,^-+$,m ) { + last if $what == 2; + $_ =~ s/\n/ /gm; + if ( $change_watch == 0 ) { + system "dch", "--newversion", "$version", "$_"; + } + else { + system "dch", "$_"; + } + $change_watch++; + } + + else { + $what++; + } + } + close(CHANGES); + + $/ = "\n"; + + + exit; + +} # end if !$stop + + system "debuild"; sub home_builder { @@ -275,3 +269,5 @@ sub home_builder { + +