Changeset 72


Ignore:
Timestamp:
Aug 31, 2007, 3:40:54 PM (12 years ago)
Author:
bruno
Message:

Fix the pbrc file content read in build2pkg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r70 r72  
    1919use Time::localtime qw(localtime);
    2020use POSIX qw(strftime);
     21use ProjectBuilder::pb qw (pb_init);
    2122
    2223use vars qw (%defpkgdir %extpkgdir %version %confparam %filteredfiles %pbrc $debug $LOG $projectbuilderver $projectbuilderrev);
     
    258259        # Keep track of what is generated for default
    259260        open(LAST,"> $pbrc{$ENV{'PBPROJ'}}") || die "Unable to create $pbrc{$ENV{'PBPROJ'}}";
    260         print LAST "$pbver-$pbtag\n";
     261        print LAST "pbroot $pbver-$pbtag = $ENV{'PBROOT'}\n";
    261262        close(LAST);
    262263    }
     
    265266    my $vertag = shift @ARGV;
    266267    if (not defined $vertag) {
    267         open(LAST,"$pbrc{$ENV{'PBPROJ'}}") || die "Unable to open $pbrc{$ENV{'PBPROJ'}}\nYou may want to precise as parameter version-tag";
    268         $vertag = <LAST>;
    269         chomp($vertag);
    270         close(LAST);
     268        if (-f $pbrc{$ENV{'PBPROJ'}}) {
     269            my $pbroot = pb_init($pbrc{$ENV{'PBPROJ'}},"pbroot");
     270            # There is only one line normaly
     271            $vertag = (keys %$pbroot)[0]
     272            $ENV{'PBROOT'} = (values %$pbroot)[0]
     273        } else {
     274            die "Unable to open $pbrc{$ENV{'PBPROJ'}}\nYou may want to precise as parameter version-tag";
     275        }
    271276    }
    272277    ($pbver,$pbtag) = split(/-/,$vertag);
Note: See TracChangeset for help on using the changeset viewer.