Changeset 4420

Show
Ignore:
Timestamp:
07/17/07 19:09:56 (6 years ago)
Author:
p_lindheimer
Message:

- Added error checking to publish script when making framework
- Added debug flag and functionality (manually set in script)
- Added FOP to framework updates
- Added upgrade directory so framework can do full version upgrades

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3/publish.pl

    r4204 r4420  
    11#!/usr/bin/perl 
    22 
     3#  Developers: Use $debug to keep all svn ci activity from occuring, messages will then be printed. All files will still be created 
     4#              and module.xml modifications made since these can be reverted. Review carefully if you care concerned that it will 
     5#              lose work. 
     6# 
     7$debug = 0; 
    38$rver = "2.3"; 
    49$fwbranch = "branches/2.3"; 
     
    1520    # temporarily chosen not to include FOP since it is likely FOP may be handled by a FOP module going forward. Othewise we will add it here. 
    1621    # 
    17     # TODO: really SHOULD put in some error chekcing... 
     22    # TODO: ADD FOP until we can get into a module 
    1823    # 
    19     system("rm -rf $framework/agi-bin $framework/bin $framework/htdocs"); 
    20     system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/agi-bin $framework/agi-bin"); 
    21     system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/bin $framework/bin"); 
    22     system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/htdocs $framework/htdocs"); 
     24    if (system("rm -rf $framework/agi-bin $framework/bin $framework/htdocs $framework/htdocs_panel $framework/upgrades $framework/libfreepbx.install.php")) { 
     25      die "FATAL: failed to remove previoulsly exported directories\n"; 
     26    } 
     27    if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/agi-bin $framework/agi-bin")) { 
     28      die "FATAL: failed to export agi-bin directory\n"; 
     29    } 
     30    if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/bin $framework/bin")) { 
     31      die "FATAL: failed to export bin directory\n"; 
     32    } 
     33    if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/htdocs $framework/htdocs")) { 
     34      die "FATAL: failed to export htdocs directory\n"; 
     35    } 
     36    if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/htdocs_panel $framework/htdocs_panel")) { 
     37      die "FATAL: failed to export htdocs_panel directory\n"; 
     38    } 
     39    if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/upgrades $framework/upgrades")) { 
     40      die "FATAL: failed to export upgrades directory\n"; 
     41    } 
     42    # svn doesn't seem to allow for a single file to be checked out so we need to do a kludgey workaround 
     43    # this is what we wanted: 
     44    # 
     45    # if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/libfreepbx.install.php $framework/libfreepbx.install.php")) { 
     46    # 
     47    if (system("svn co --non-recursive https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch $framework/tmp")) { 
     48      die "FATAL: failed to checkout branch with libfreepbx.install.php\n"; 
     49    } 
     50    if (system("mv $framework/tmp/libfreepbx.install.php $framework/")) { 
     51      die "FATAL: failed to mv libfreepbx.install.php to $framework\n"; 
     52    } 
     53    if (system("rm -rf $framework/tmp")) { 
     54      die "FATAL: failed to remove $framework/tmp\n"; 
     55    } 
    2356 
    2457    # Now we must remove a few files which users may have legitimately edited. For now this is the main.conf.php file which is the current 
    2558    # ARI file used for editing paramters and options. 
    2659    # 
    27     system("rm -rf $framework/htdocs/recordings/includes/main.conf.php"); 
     60    if (system("rm -rf $framework/htdocs/recordings/includes/main.conf.php")) { 
     61      die "FATAL: failed to trim main.conf.php ARI file\n"; 
     62    } 
    2863     
    2964    # Remove from htdocs root mainstyle.css and index.html as these are owned by root (need to investigate why these are there 
    3065    # and change that. Also some others 
    3166    # 
    32     system("rm -rf $framework/htdocs/mainstyle.css"); 
    33     system("rm -rf $framework/htdocs/index.html"); 
    34     system("rm -rf $framework/htdocs/admin/modules/_cache"); 
     67    # TODO: check if these are stiff there and need to be special cased 
     68    # 
     69    if (system("rm -rf $framework/htdocs/mainstyle.css")) { 
     70      die "FATAL: failed to trim htdocs/mainstyle.css\n"; 
     71    } 
     72    if (system("rm -rf $framework/htdocs/index.html")) { 
     73      die "FATAL: failed to trim htdocs/index.html\n"; 
     74    } 
     75    if (system("rm -rf $framework/htdocs/admin/modules/_cache")) { 
     76      die "FATAL: failed to trim modules/_cache\n"; 
     77    } 
    3578  } 
    3679 
     
    5699    $files .= "$x "; 
    57100  } 
    58   system("svn ci -m \"Auto Check-in of any outstanding patches\" $files"); 
     101  if ($debug) { 
     102    print "svn ci -m \"Auto Check-in of any outstanding patches\" $files\n"; 
     103  } else { 
     104    system("svn ci -m \"Auto Check-in of any outstanding patches\" $files"); 
     105  } 
    59106  chdir(".."); 
    60107  # Now we know the version. Create the tar.gz 
     
    71118  print FH $newxml; 
    72119  close FH; 
    73   system("mv $filename ../../release/$rver"); 
    74   system("svn add ../../release/$rver/$filename"); 
    75   system("svn ps svn:mime-type application/tgz ../../release/$rver/$filename"); 
    76   system("svn ci ../../release/$rver/$filename $rawname/module.xml -m \"Module Publish Script: $rawname $vers\""); 
     120  if ($debug) { 
     121    print "mv $filename ../../release/$rver\n"; 
     122    print "svn add ../../release/$rver/$filename\n"; 
     123    print "svn ps svn:mime-type application/tgz ../../release/$rver/$filename\n"; 
     124    print "svn ci ../../release/$rver/$filename $rawname/module.xml -m \"Module Publish Script: $rawname $vers\"\n"; 
     125  } else { 
     126    system("mv $filename ../../release/$rver"); 
     127    system("svn add ../../release/$rver/$filename"); 
     128    system("svn ps svn:mime-type application/tgz ../../release/$rver/$filename"); 
     129    system("svn ci ../../release/$rver/$filename $rawname/module.xml -m \"Module Publish Script: $rawname $vers\""); 
     130  } 
    77131} 
    78132