Ignore:
Timestamp:
Jun 8, 2006, 2:15:09 PM (13 years ago)
Author:
bcornec
Message:

merge -r641:651 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/mkchangelog.pl

    r649 r652  
    1010use strict;
    1111use Date::Manip;
     12use File::Basename;
     13use English;
    1214
    1315my $log = "";
     
    1618my $pkg2;
    1719my $outfile = $ARGV[2];
    18 my $TOOLHOME = $ENV{TOOLHOME};
    1920my $chglog = "";
    2021my $ndate = "";
     
    3031        (not (defined $pkg)) || ($pkg eq "") ||
    3132        (not (defined $outfile)) || ($outfile eq ""));
     33
     34my $TOOLHOME;
     35$tmp = dirname($PROGRAM_NAME);
     36if ($tmp =~ /^\//) {
     37    $TOOLHOME = $tmp;
     38    }
     39else {
     40    $TOOLHOME = "$ENV{PWD}/$tmp";
     41    }
     42
     43die "TOOLHOME doesn't exist" if (not (defined $TOOLHOME));
    3244
    3345if (-f "$TOOLHOME/../$pkg/ChangeLog") {
     
    5264$tmp = <INPUT>;
    5365$tmp = <INPUT>;
     66if ($dtype eq "announce") {
     67    print OUTPUT $tmp;
     68}
    5469$tmp = <INPUT>;
     70if ($dtype eq "announce") {
     71    print OUTPUT $tmp;
     72}
    5573
    5674# Handle each block separated by newline
     
    5977    chomp($date);
    6078    $date =~ s/\(([0-9-]+)\)/$1/;
    61     print "**$date**\n";
     79    #print "**$date**\n";
    6280    $ndate = UnixDate($date,"%a", "%b", "%d", "%Y");
    63     print "**$ndate**\n";
     81    #print "**$ndate**\n";
    6482    if ($dtype eq "rpm") {
    65         printf OUTPUT "* $ndate Bruno Cornec <bruno\@mondorescue.org> $ver\n";
    66         printf OUTPUT "- Updated to $ver\n";
     83        print OUTPUT "* $ndate Bruno Cornec <bruno\@mondorescue.org> $ver\n";
     84        print OUTPUT "- Updated to $ver\n";
     85        }
    6786
    68         $tmp = <INPUT>;
    69         while ($tmp !~ /^$/) {
    70             printf OUTPUT $tmp;
    71             $tmp = <INPUT>;
    72         }
    73         printf OUTPUT "\n";
     87    $tmp = <INPUT>;
     88    while ($tmp !~ /^$/) {
     89        print OUTPUT $tmp;
     90        last if (eof(INPUT));
     91        $tmp = <INPUT>;
    7492    }
     93    print OUTPUT "\n";
     94    last if (eof(INPUT));
     95    last if ($dtype eq "announce");
    7596}
    7697close(OUTPUT);
Note: See TracChangeset for help on using the changeset viewer.