Changeset 66


Ignore:
Timestamp:
Aug 31, 2007, 1:19:46 PM (10 years ago)
Author:
bruno
Message:

Add the -r option to support multiple version in parallel

Location:
0.5/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 0.5/pb/bin/pb

    r63 r66  
    4141my $pbdate = strftime("%Y-%m-%d", @date);
    4242
    43 getopts('hl:p:qtv',\%opts);
     43getopts('hl:p:qr:tv',\%opts);
    4444
    4545version_init();
     
    7070die syntax() if (not defined $action);
    7171
     72# Handle root of the project if defined
     73if (defined $opts{'r'}) {
     74    $ENV{'PBROOT'} = $opts{'r'};
     75}
    7276# Handles project name if any
    7377if (defined $opts{'p'}) {
     
    253257        print $LOG "Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n" if ($debug >= 0);
    254258        # Keep track of what is generated for build2pkg default
    255         open(LAST,"> $ENV{'PBDESTDIR'}/LAST") || die "Unable to create $ENV{'PBDESTDIR'}/LAST";
     259        open(LAST,"> $ENV{'PBTOPDIR'}/LAST") || die "Unable to create $ENV{'PBTOPDIR'}/LAST";
    256260        print LAST "$pbver-$pbtag\n";
    257261        close(LAST);
     
    261265    my $vertag = shift @ARGV;
    262266    if (not defined $vertag) {
    263         open(LAST,"$ENV{'PBDESTDIR'}/LAST") || die "Unable to open $ENV{'PBDESTDIR'}/LAST\nYou may want to precise as parameter version-tag";
     267        open(LAST,"$ENV{'PBTOPDIR'}/LAST") || die "Unable to open $ENV{'PBTOPDIR'}/LAST\nYou may want to precise as parameter version-tag";
    264268        $vertag = <LAST>;
    265269        chomp($vertag);
     
    279283    foreach my $pbpkg (@pkgs) {
    280284        my $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
    281         print $LOG "Handling source file $src\n" if ($debug >= 0);
     285        print $LOG "Source file: $src\n" if ($debug >= 0);
    282286
    283287        if ($dtype eq "rpm") {
  • 0.5/pb/lib/ProjectBuilder/common.pm

    r52 r66  
    3333}
    3434#
    35 # Use project configuration file
     35# Use project configuration file if needed
    3636#
    37 pb_init("$ENV{'PBETC'}");
     37if (not defined $ENV{'PBROOT'}) {
     38    pb_init("$ENV{'PBETC'}");
    3839
    39 if (not defined $proj) {
    40     # Take the first as the default project
    41     $proj = (keys %pbroot)[0];
     40    if (not defined $proj) {
     41        # Take the first as the default project
     42        $proj = (keys %pbroot)[0];
    4243    print $LOG "Using $proj as default project as none has been specified\n" if (($debug >= 0) and (defined $proj));
     44    }
     45    die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj));
     46
     47    $ENV{'PBROOT'} = $pbroot{$proj};
     48} else {
     49    die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj));
    4350}
    44 die "No project defined - use env var PBPROJ or -p proj" if (not (defined $proj));
    45 
    46 $ENV{'PBROOT'} = $pbroot{$proj};
    4751
    4852#
Note: See TracChangeset for help on using the changeset viewer.