Changeset 254


Ignore:
Timestamp:
10/25/07 02:22:19 (6 years ago)
Author:
bruno
Message:

Change pb_changelog interface in order to have a way to not generate logs for projects not ready for it.

Location:
devel/pb/lib/ProjectBuilder
Files:
2 edited

Legend:

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

    r242 r254  
    595595        # special case for ChangeLog only for pb 
    596596        } elsif (($tmp =~ /^yes$/) && ($s =~ /^PBLOG$/) && ($line =~ /^PBLOG$/)) { 
    597             $tmp = ""; 
    598597            my $p = $defpkgdir->{$pbpkg}; 
    599598            $p = $extpkgdir->{$pbpkg} if (not defined $p); 
    600             pb_changelog($dtype, $pbpkg, $pbtag, $pbsuf, $p, \*DEST); 
     599            pb_changelog($dtype, $pbpkg, $pbver, $pbtag, $pbsuf, $p, \*DEST, $tmp); 
     600            $tmp = ""; 
    601601        } 
    602602        $line =~ s|$s|$tmp|; 
  • devel/pb/lib/ProjectBuilder/Changelog.pm

    r227 r254  
    1616my $dtype = shift; 
    1717my $pkg = shift; 
     18my $pbver = shift; 
    1819my $pbtag = shift; 
    1920my $dsuf = shift; 
    2021my $path = shift; 
    2122my $OUTPUT = shift; 
     23my $doit = shift; 
    2224 
    2325my $log = ""; 
     
    2830return("\n") if ((not (defined $dtype)) || ($dtype eq "") ||  
    2931        (not (defined $pkg)) || ($pkg eq "") ||  
     32        (not (defined $pbver)) || ($pbver eq "") ||  
    3033        (not (defined $pbtag)) || ($pbtag eq "") ||  
    3134        (not (defined $dsuf)) || ($dsuf eq "") ||  
    3235        (not (defined $path)) || ($path eq "") ||  
    3336        (not (defined $OUTPUT)) || ($OUTPUT eq "")); 
     37        (not (defined $doit)) || ($doit eq "")); 
    3438 
    3539my $chglog = "$ENV{'PBROOT'}/$path/ChangeLog"; 
    36 if (! -f $chglog) { 
     40if ((! -f $chglog) && ($doit eq "yes")) { 
    3741    #print "No ChangeLog file ($chglog) for $pkg\n"; 
    3842    return("\n"); 
     43} 
     44 
     45# If we don't need to do it, fake something 
     46if ($doit ne "yes") { 
     47    my @date=(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst()); 
     48    my $date = strftime("%Y-%m-%d", @date); 
     49    my $ndate = UnixDate($date,"%a", "%b", "%d", "%Y"); 
     50    my $n2date = &UnixDate($date,"%a, %d %b %Y %H:%M:%S %z"); 
     51    if (($dtype eq "rpm") || ($dtype eq "fc")) { 
     52        my $ver2 = "$pbver-$pbtag$dsuf"; 
     53        print $OUTPUT "* $ndate $packager->{$ENV{'PBPROJ'}} $ver2\n"; 
     54        print $OUTPUT "- Updated to $pbver\n"; 
     55        } 
     56    if ($dtype eq "deb") { 
     57        print $OUTPUT "$pkg ($pbver) unstable; urgency=low\n"; 
     58        print $OUTPUT "\n"; 
     59        print $OUTPUT " -- $packager->{$ENV{'PBPROJ'}}  $n2date\n\n\n"; 
     60        } 
     61    return; 
    3962} 
    4063 
Note: See TracChangeset for help on using the changeset viewer.