Changeset 1425 in ProjectBuilder


Ignore:
Timestamp:
Feb 25, 2012, 3:43:20 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Adds a new -k option to kep some temporary files for debug purposes
  • Fix newvm as the awk call was broken
Location:
devel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r1392 r1425  
    140140my $pbinit=shift || undef;
    141141my $action=shift;
     142my $pbkeep=shift || 0;
    142143my $ver;
    143144my $tag;
     
    251252
    252253# Need to do that earlier as it's used potentialy in pb_cms_add
    253 pb_temp_init();
     254pb_temp_init($pbkeep);
    254255pb_log(2,"PBTMP: $ENV{'PBTMP'}\n");
    255256
  • devel/pb/bin/pb

    r1424 r1425  
    4444my $pbforce = 0;            # Force VE/VM rebuild
    4545my $pbsnap = 0;             # Do not use snapshot mode for VM/VE by default
     46my $pbkeep = 0;             # keep temporary directory at the end
    4647my $option = "";            # Not used
    4748my @pkgs;                   # list of packages
     
    149150
    150151New version of the project to create based on the current one.
     152
     153=item B<-k|--keep>
     154
     155Keep the temporary dir where files have been created in or der to help debug
    151156
    152157=item B<--rebuild>
     
    490495        "iso|i=s" => \$opts{'i'},
    491496        "version|V=s" => \$opts{'V'},
     497        "keep|k" => \$opts{'k'},
    492498) || pb_syntax(-1,0);
    493499
     
    509515if (defined $opts{'S'}) {
    510516    $pbsnap=1;
     517}
     518if (defined $opts{'k'}) {
     519    $pbkeep=1;
    511520}
    512521if (defined $opts{'l'}) {
     
    556565# Handles project name if any
    557566# And get global params
    558 ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir) = pb_env_init($opts{'p'},$pbinit,$action);
     567($filteredfiles, $supfiles, $defpkgdir, $extpkgdir) = pb_env_init($opts{'p'},$pbinit,$action,$pbkeep);
    559568
    560569#
     
    21192128        }
    21202129    }
    2121     unlink("$ENV{'PBDESTDIR'}/pbscript.$$") if (($cmt =~ /^(V[ME]|RM)/) || ($cmt =~ /Packages/));
     2130    unlink("$ENV{'PBDESTDIR'}/pbscript.$$") if ((($cmt =~ /^(V[ME]|RM)/) || ($cmt =~ /Packages/)) && ($pbkeep eq 0));
    21222131
    21232132    pb_log(2,"Before halt, vmexist: $vmexist, vmpid: $vmpid\n");
     
    27592768our $pblocale = "";
    27602769pb_log_init($pbdebug, $pbLOG);
    2761 pb_temp_init();
     2770EOF
     2771    print SCRIPT << "EOF";
     2772pb_temp_init($pbkeep);
    27622773
    27632774EOF
     
    29752986EOF
    29762987        foreach my $c (@sudocmds) {
    2977             print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}}   ALL = NOPASSWD: $c\n\";";
     2988            print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}}   ALL = NOPASSWD: $c\";\n";
    29782989        }
    29792990    } elsif ($vtype =~ /^rm/) {
     
    29832994EOF
    29842995        foreach my $c (@sudocmds) {
    2985             print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}}   ALL = NOPASSWD: $c\n\";";
     2996            print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}}   ALL = NOPASSWD: $c\";\n";
    29862997        }
    29872998    } else {
     
    30703081}
    30713082EOF
    3072         print SCRIPT << "EOF";
    3073 pb_system("rm -rf ProjectBuilder-* ; rm -rf project-builder-* ; rm -rf `perl -V:installvendorlib  | awk -F"'" '{print  \$2}'`/ProjectBuilder ; $cmdget ; gzip -cd ProjectBuilder-latest.tar.gz | tar xf - ; cd ProjectBuilder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf ProjectBuilder-* ; gzip -cd project-builder-latest.tar.gz | tar xf - ; cd project-builder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf project-builder-* ;","Building Project-Builder");
     3083        print SCRIPT << 'EOF';
     3084pb_system("rm -rf ProjectBuilder-* ; rm -rf project-builder-* ; rm -rf `perl -V:installvendorlib  | awk -F\"'\" '{print \$2}'`/ProjectBuilder ;
     3085EOF
     3086        print SCRIPT " $cmdget ; ";
     3087        print SCRIPT << 'EOF'
     3088gzip -cd ProjectBuilder-latest.tar.gz | tar xf - ; cd ProjectBuilder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf ProjectBuilder-* ; gzip -cd project-builder-latest.tar.gz | tar xf - ; cd project-builder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf project-builder-* ;","Building Project-Builder");
    30743089EOF
    30753090    } elsif ($itype =~ /^pkg/) {
Note: See TracChangeset for help on using the changeset viewer.