Changeset 6


Ignore:
Timestamp:
07/29/07 01:21:40 (6 years ago)
Author:
bruno
Message:

Ok seems better interm of organization with AppConfig? usage

Location:
devel/pb
Files:
1 added
1 deleted
3 edited

Legend:

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

    r5 r6  
    1212use Getopt::Std; 
    1313 
    14 use lib qw (lib /etc/pb); 
    15 use vars qw (%defpkgdir %extpkgdir %version); 
     14use lib qw (lib etc); 
     15use vars qw (%defpkgdir %extpkgdir @version); 
    1616use common qw (set_env); 
    1717use pb qw (defpkgdir extpkgdir version pb_init); 
     
    3030 
    3131print "PBPROJ: $ENV{'PBPROJ'}\n"; 
     32 
     33cms_init(); 
  • devel/pb/lib/cms.pm

    r5 r6  
    1414# Expects we are in the right directory to launch CMS commands 
    1515 
    16 my @args = ("svn", "info", "2>&1", "/dev/null"); 
     16sub cms_init { 
     17 
    1718my $ret; 
    18 system(@args) == 0 or die "system @args failed: $?"; 
     19 
     20chdir "$ENV{'PBROOT'}"; 
     21system("svn info 2>&1 /dev/null") == 0 or die "system svn info failed: $?"; 
    1922if ($? == -1) { 
    2023    print "failed to execute: $!\n"; 
     
    2427    $ret =  $? >> 8; 
    2528    if ($ret == 0) { 
    26         $ENV{'REVISION'}=`(cd $PBROOT/.. ; svnversion .)`; 
     29        $ENV{'REVISION'}=`(cd "$ENV{'PBROOT'}/.." ; svnversion .)`; 
    2730        $ENV{'CMSLOG'}="svn log"; 
    2831        $ENV{'CMSEXP'}="svn export"; 
    2932    } else { 
    3033        # By default if not SVN take CVS 
    31         $ENV{'REVISION'}=`(cd $PBROOT/.. ; cvs  rannotate  -f . 2>&1 | awk '{print $1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`; 
     34        $ENV{'REVISION'}=`(cd "$ENV{'PBROOT'}/.." ; cvs  rannotate  -f . 2>&1 | awk '{print $1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`; 
    3235        $ENV{'CMSLOG'}="cvs log"; 
    3336        $ENV{'CMSEXP'}="cvs export" 
    34         $ENV{'CVSROOT'}=$ENV{'CVSVAR'}; 
    3537    } 
    3638} 
     39} 
    37401; 
  • devel/pb/lib/common.pm

    r5 r6  
    1010 
    1111use lib qw (lib); 
     12use pb qw (pb_init); 
    1213use strict; 
    1314use File::Basename; 
    1415use ExtUtils::Command; 
    1516use File::Temp qw /tempdir/; 
    16 use vars qw (%defpkgdir %extpkgdir %version &pb_init); 
     17use vars qw (%defpkgdir %extpkgdir %version); 
    1718 
    1819$ENV{'PBCONF'} = "/etc/pb"; 
     
    3233 
    3334# Use project configuration file 
    34 require "$ENV{'PBCONF'}/$proj.pb"; 
    35 pb_init(); 
     35pb_init("$ENV{'PBCONF'}/$proj.pb"); 
    3636 
    3737# Check content 
Note: See TracChangeset for help on using the changeset viewer.