Changeset 18 in ProjectBuilder for devel/pb/bin


Ignore:
Timestamp:
Jul 31, 2007, 12:50:36 AM (17 years ago)
Author:
Bruno Cornec
Message:

cms2build roughly working

Location:
devel/pb/bin
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb.pl

    r17 r18  
    1010# Syntax: pb [-p project] <action> [<params>...]
    1111
    12 use strict;
     12use strict 'vars';
    1313use Switch;
    1414use Getopt::Std;
     
    2121use POSIX qw(strftime);
    2222
     23use vars qw (%defpkgdir %extpkgdir %version %confparam %filteredfiles);
    2324use lib qw (lib);
    24 use vars qw (%defpkgdir %extpkgdir %version %param %filteredfiles);
    2525use common qw (env_init);
    26 use pb qw (defpkgdir extpkgdir version param filteredfiles pb_init);
     26use pb qw (pb_init);
    2727use distro qw (distro_init);
    2828use cms;
     
    7070    } elsif ($ARGV[0] =~ /^all$/) {
    7171        @pkgs = keys %defpkgdir;
    72         push(@pkgs, keys %extpkgdir);
     72        if (defined %extpkgdir) {
     73            my $k = keys %extpkgdir;
     74            if (defined $k) {
     75                push(@pkgs, keys %extpkgdir);
     76            }
     77        }
    7378    } else {
    7479        @pkgs = @ARGV;
     
    231236                }
    232237            }
    233             # Prepare the dest directory for archive
    234             if (-x "$ENV{'PBCONF'}/$pkg/pbpkginit") {
    235                 system("cd $dest ; $ENV{'PBCONF'}/$pkg/pbinit");
    236                 if ($? == -1) {
    237                     print "failed to execute: $!\n";
    238                 } elsif ($? & 127) {
    239                     printf "child died with signal %d, %s coredump\n", ($? & 127),  ($? & 128) ? 'with' : 'without';
    240                 } else {
    241                     print " $dest\n";
    242                 }
    243             }
    244             # Archive dest dir
    245             chdir "$dest/..";
    246             print "Creating $pkg tar files (gzip... ";
    247             system("tar cfphz $pkg-$pbver.tar.gz $pkg-$pbver");
     238        }
     239        close(D);
     240        # Prepare the dest directory for archive
     241        if (-x "$ENV{'PBCONF'}/$pkg/pbpkginit") {
     242            system("cd $dest ; $ENV{'PBCONF'}/$pkg/pbinit");
    248243            if ($? == -1) {
    249244                print "failed to execute: $!\n";
     
    251246                printf "child died with signal %d, %s coredump\n", ($? & 127),  ($? & 128) ? 'with' : 'without';
    252247            } else {
    253                 print " OK)\n";
    254                 print "Under $dest/../$pkg-$pbver.tar.gz\n";
    255             }
    256         }
    257         close(D);
     248                print " $dest\n";
     249            }
     250        }
     251        # Archive dest dir
     252        chdir "$dest/..";
     253        print "Creating $pkg tar files (gzip... ";
     254        system("tar cfphz $pkg-$pbver.tar.gz $pkg-$pbver");
     255        if ($? == -1) {
     256            print "failed to execute: $!\n";
     257        } elsif ($? & 127) {
     258            printf "child died with signal %d, %s coredump\n", ($? & 127),  ($? & 128) ? 'with' : 'without';
     259        } else {
     260            print " OK)\n";
     261            print "Under $dest/../$pkg-$pbver.tar.gz\n";
     262        }
    258263    }
    259264} else {
     
    290295        # special case for ChangeLog
    291296        } elsif (($tmp =~ /^yes$/) && ($s =~ /^PBLOG$/)) {
    292             $tmp = changelog($dtype, $pkg, $pbtag, $dsuf, \*DEST);
     297            my $p = $defpkgdir{$pkg};
     298            $p = $extpkgdir{$pkg} if (not defined $p);
     299            $tmp = changelog($dtype, $pkg, $pbtag, $dsuf, $p, \*DEST);
    293300        }
    294301        $line =~ s|$s|$tmp|;
Note: See TracChangeset for help on using the changeset viewer.