mirror of
https://github.com/fspc/gbootroot.git
synced 2025-02-23 09:03:23 -05:00
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/* .
This commit is contained in:
parent
af71249d42
commit
1c8cd7185d
@ -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 (<STDIN>) {
|
||||
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 (<CHANGES>) {
|
||||
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 {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user