Ignore:
Timestamp:
Nov 15, 2007, 12:04:08 AM (12 years ago)
Author:
bruno
Message:

Adds support of NEWS, AUTHORS, svn|cvs.log, ChangeLog? files and changelog info from single files under pbconf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/ProjectBuilder/Base.pm

    r273 r285  
    803803    $ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; svnversion .)`;
    804804    chomp($ENV{'PBREVISION'});
    805     $ENV{'PBCMSLOG'}="svn log";
    806805    $ENV{'PBCMSLOGFILE'}="svn.log";
    807806} elsif ($cms->{$proj} eq "flat") {
    808807    $ENV{'PBREVISION'}="flat";
    809     $ENV{'PBCMSLOG'}="/bin/true";
    810808    $ENV{'PBCMSLOGFILE'}="flat.log";
    811809} elsif ($cms->{$proj} eq "cvs") {
     
    814812    #chomp($ENV{'PBREVISION'});
    815813    $ENV{'PBREVISION'}="CVS";
    816     $ENV{'PBCMSLOG'}="cvs log";
    817814    $ENV{'PBCMSLOGFILE'}="cvs.log";
    818815    #
     
    868865}
    869866
     867
     868sub pb_create_authors {
     869
     870my $authors=shift;
     871my $dest=shift;
     872my $cms=shift;
     873
     874return if ((not defined $authors) || (! -f $authors));
     875open(AUT,$authors) || die "Unable to open $authors";
     876open(DAUTH,"> $dest/AUTHORS") || die "Unable to create $dest/AUTHORS";
     877print DAUTH "Authors of the project are:\n";
     878print DAUTH "===========================\n";
     879while (<AUT>) {
     880    my ($nick,$gcos) = split(/:/);
     881    print DAUTH "$gcos";
     882    print DAUTH " ($nick under $cms)\n" if (defined $cms);
     883}
     884close(DAUTH);
     885close(AUTH);
     886}
     887
    870888sub pb_cms_log {
    871889my $cms = shift;
    872890my $pkgdir = shift;
    873 my $destfile = shift;
     891my $dest = shift;
     892my $authors = shift;
     893
     894pb_create_authors($authors,$dest,$cms->{$ENV{'PBPROJ'}});
    874895
    875896if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
    876     pb_system("svn log -v $pkgdir > $destfile","Extracting log info from SVN");
     897    pb_system("svn log -v $pkgdir > $dest/$ENV{'PBCMSLOGFILE'}","Extracting log info from SVN");
     898    if ((-x "/usr/bin/svn2cl") && (! -f $dest/ChangeLog)) {
     899        pb_system("/usr/bin/svn2cl --group-by-day --authors=$authors -i -o $dest/ChangeLog $pkgdir","Generating ChangeLog from SVN");
     900    }
    877901} elsif ($cms->{$ENV{'PBPROJ'}} eq "flat") {
    878902    # Nothing to do
     
    880904    my $tmp=basename($pkgdir);
    881905    # CVS needs a relative path !
    882     pb_system("cvs log $tmp > $destfile","Extracting log info from CVS");
     906    pb_system("cvs log $tmp > $dest/$ENV{'PBCMSLOGFILE'}","Extracting log info from CVS");
     907    if ((-x "/usr/bin/svn2cl") && (! -f $dest/ChangeLog)) {
     908        pb_system("/usr/bin/cvs2cl --group-by-day -U $authors -f $dest/ChangeLog $pkgdir","Generating ChangeLog from SVN");
     909    }
    883910} else {
    884911    die "cms $cms->{$ENV{'PBPROJ'}} unknown";
     
    10551082my $extpkgdir = shift;
    10561083my $pbpackager = shift;
     1084my $chglog = shift || undef;
    10571085
    10581086# For the moment not dynamic
     
    10791107            my $p = $defpkgdir->{$pbpkg};
    10801108            $p = $extpkgdir->{$pbpkg} if (not defined $p);
    1081             pb_changelog($dtype, $pbpkg, $pbver, $pbtag, $pbsuf, $p, \*DEST, $tmp);
     1109            pb_changelog($dtype, $pbpkg, $pbver, $pbtag, $pbsuf, $p, \*DEST, $tmp, $chglog);
    10821110            $tmp = "";
    10831111        }
Note: See TracChangeset for help on using the changeset viewer.