瀏覽代碼

fix bugs, add no archive mode

georges 25 年之前
父節點
當前提交
e79f41c039
共有 1 個文件被更改,包括 23 次插入16 次删除
  1. 23 16
      pandatool/src/scripts/builder.pl

+ 23 - 16
pandatool/src/scripts/builder.pl

@@ -10,6 +10,7 @@ $WIN_INSTALLDIR="\\\\cxgeorge-d01\\c\\pandabuilds\\win";
 # $DEBUG_TREECOPY = 1;
 # $DEBUG_TREECOPY = 1;
 
 
 # $DEBUG_GENERATE_PYTHON_CODE_ONLY = 1;
 # $DEBUG_GENERATE_PYTHON_CODE_ONLY = 1;
+$DONT_ARCHIVE_OLD_BUILDS = 0;
 
 
 $BLD_DTOOL_ONLY=0;
 $BLD_DTOOL_ONLY=0;
 $DIRPATH_SEPARATOR=':';   # set to ';' for non-cygwin NT perl
 $DIRPATH_SEPARATOR=':';   # set to ';' for non-cygwin NT perl
@@ -21,6 +22,7 @@ $ENV{'TCSH_NO_CSHRC_CHDIR'}='1';
 $ENV{'HOME'}="/home/builder";
 $ENV{'HOME'}="/home/builder";
 $ENV{'USER'}="builder";
 $ENV{'USER'}="builder";
 $ENV{'USERNAME'}=$ENV{'USER'};
 $ENV{'USERNAME'}=$ENV{'USER'};
+$DONT_ARCHIVE_OLD_BUILDS = (($ENV{'DONT_ARCHIVE_OLD_BUILDS'} ne "") || $DONT_ARCHIVE_OLD_BUILDS);
 
 
 sub logmsg() {
 sub logmsg() {
    my $msg = shift;
    my $msg = shift;
@@ -209,7 +211,9 @@ sub gen_python_code() {
        $genpyth_str="python ";
        $genpyth_str="python ";
     }
     }
 
 
-    $outputdir = $WINBLDROOT."\\direct\\lib\\py\\Opt".$ENV{'PANDA_OPTIMIZE'}."-Win32";
+    $outputdir = $WINBLDROOT."\\direct\\lib\\py";
+    &mymkdir($outputdir);
+    $outputdir.= "\\Opt".$ENV{'PANDA_OPTIMIZE'}."-Win32";
     &mymkdir($outputdir);
     &mymkdir($outputdir);
 
 
     $genpyth_str.="generatePythonCode -v -d '".$outputdir."' -e '".$WINBLDROOT."\\direct\\src\\extensions' -i libdtool libpandaexpress libpanda libdirect";
     $genpyth_str.="generatePythonCode -v -d '".$outputdir."' -e '".$WINBLDROOT."\\direct\\src\\extensions' -i libdtool libpandaexpress libpanda libdirect";
@@ -262,6 +266,8 @@ sub buildall() {
 
 
     &mychdir($CYGBLDROOT);  # get out of src dirs to allow them to be moved/renamed
     &mychdir($CYGBLDROOT);  # get out of src dirs to allow them to be moved/renamed
     unlink($CYGBLDROOT."/dtool/dtool_config.h");  # fix freakish NTFS bug, this file is regenerated by ppremake anyway
     unlink($CYGBLDROOT."/dtool/dtool_config.h");  # fix freakish NTFS bug, this file is regenerated by ppremake anyway
+
+    &gen_python_code();
 }
 }
 
 
 # assumes environment already attached to TOOL/PANDA/DIRECT/TOONTOWN
 # assumes environment already attached to TOOL/PANDA/DIRECT/TOONTOWN
@@ -341,7 +347,8 @@ if($DEBUG_TREECOPY) {
 }
 }
 
 
 if($DEBUG_GENERATE_PYTHON_CODE_ONLY) {
 if($DEBUG_GENERATE_PYTHON_CODE_ONLY) {
-    goto 'AFTER_DBGBUILD';
+    &gen_python_code();
+    exit(0);
 }
 }
 
 
 # goto 'SKIP_REMOVE';
 # goto 'SKIP_REMOVE';
@@ -404,12 +411,12 @@ if(-e $CYGBLDROOT."/debug") {
              "DO_LOG","NT cmd");  
              "DO_LOG","NT cmd");  
 }
 }
 
 
+BEFORE_DBGBUILD:
+
 &buildall("*** Starting Debug Build (Opt=1) at ".&gettimestr()." ***");
 &buildall("*** Starting Debug Build (Opt=1) at ".&gettimestr()." ***");
 
 
 AFTER_DBGBUILD:
 AFTER_DBGBUILD:
 
 
-&gen_python_code();
-
 &myexecstr("cvs checkout -R ".$dirstodostr." |& egrep -v 'Updating|^\\?'",
 &myexecstr("cvs checkout -R ".$dirstodostr." |& egrep -v 'Updating|^\\?'",
           "cvs checkout failed!","DO_LOG","NO_PANDA_ATTACH");
           "cvs checkout failed!","DO_LOG","NO_PANDA_ATTACH");
 
 
@@ -432,8 +439,6 @@ delete $ENV{'USE_BROWSEINFO'};
 $ENV{'PANDA_OPTIMIZE'}='2';
 $ENV{'PANDA_OPTIMIZE'}='2';
 &buildall("*** Starting Install Build (Opt=2) at ".&gettimestr()." ***");
 &buildall("*** Starting Install Build (Opt=2) at ".&gettimestr()." ***");
 
 
-&gen_python_code();
-
 # opt2 creates .sbr files when it should not
 # opt2 creates .sbr files when it should not
 #foreach my $dir1 (@dirstodolist) {
 #foreach my $dir1 (@dirstodolist) {
 #   &mychdir($CYGBLDROOT."/".$dir1);
 #   &mychdir($CYGBLDROOT."/".$dir1);
@@ -446,8 +451,6 @@ $ENV{'PANDA_OPTIMIZE'}='2';
 $ENV{'PANDA_OPTIMIZE'}='4';
 $ENV{'PANDA_OPTIMIZE'}='4';
 &buildall("*** Starting Release Build (Opt=4) at ".&gettimestr()." ***");
 &buildall("*** Starting Release Build (Opt=4) at ".&gettimestr()." ***");
 
 
-&gen_python_code();
-
 # opt2 creates .sbr files when it should not
 # opt2 creates .sbr files when it should not
 #foreach my $dir1 (@dirstodolist) {
 #foreach my $dir1 (@dirstodolist) {
 #   &mychdir($CYGBLDROOT."/".$dir1);
 #   &mychdir($CYGBLDROOT."/".$dir1);
@@ -493,14 +496,19 @@ sub archivetree() {
 
 
 #goto 'StartTreeCopy';  #DBG
 #goto 'StartTreeCopy';  #DBG
 
 
-&logmsg("*** Archiving old builds on install server at ".&gettimestr()." ***");
+if($DONT_ARCHIVE_OLD_BUILDS) {
+   &myexecstr("rd /s /q ".$opt1dir." ".$opt2dir,"","DO_LOG","NT cmd");  # dont bother checking errors here, probably just some shell has the dir cd'd to
 
 
-if(-e $opt1dir) {
-    &archivetree($opt1dir,$newdayarchivedirname."\\debug");
-}
+} elsif((-e $opt1dir) || (-e $opt2dir)) {
+    &logmsg("*** Archiving old builds on install server at ".&gettimestr()." ***");
+
+    if(-e $opt1dir) {
+        &archivetree($opt1dir,$newdayarchivedirname."\\debug");
+    }
 
 
-if(-e $opt2dir) {
-    &archivetree($opt2dir,$newdayarchivedirname."\\install");
+    if(-e $opt2dir) {
+        &archivetree($opt2dir,$newdayarchivedirname."\\install");
+    }
 }
 }
 
 
 StartTreeCopy:
 StartTreeCopy:
@@ -538,7 +546,6 @@ exit(0);
 # TODO:
 # TODO:
 # possibly auto delete or compress old archived blds
 # possibly auto delete or compress old archived blds
 # build DLLs with version stamp set by this script
 # build DLLs with version stamp set by this script
-# implement no-archive mode
 # implement build-specific opttype mode
 # implement build-specific opttype mode
-# generate python code
+