All pastes #368571 Raw Edit

Stuff

public php v1 · immutable
#368571 ·published 2007-02-23 04:54 UTC
rendered paste body
<?echo "<title>CVS - APP UPDATE</title>";$now = date("Ymd"); define("MAINAPP", "DRUPAL");define("SRC",":pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal");define("WEBDIR", "www_base");define("BASE", "/usr/home/dev/public_html/drupal/");define("BACKUPDIR", BASE."backup/www-$now");define("SITE","sites/default");define("CHECKOUTDIR",BASE.WEBDIR);// Main app Releasesdefine("REL","DRUPAL-5-1");    // # DRUPAL-4-6, DRUPAL-4-7, DRUPAL-5, DRUPAL-5-1 HEADdefine("CONTRIB_REL","HEAD");  // Contrib Module Tag  echo "<br>";echo "<h3>This script will check out " . MAINAPP . " version " . REL . "</h3>";echo "<br>Checking if local checkout directory exists ...</br>";if(!is_dir(BASE.WEBDIR)){  echo "Local checkout dir " . BASE.WEBDIR . " does not exist.<br>";  echo "<br>We will actually attempt to create it ..";    if(!mkdir(BASE.WEBDIR, 0775))  {	  echo "Unable to create checkout directory, in file " . __FILE__ . " on line " . __LINE__ . ". " ;	  echo "Pulling out,in disgust.";	  die();  }}     echo "Great!<br> Checkout directory exists.<br>"; 	 echo "<br>Checking to see if we have to update or checkout.";     	 chdir(CHECKOUTDIR);	 if(!is_dir(BASE.WEBDIR."/CVS")){		 echo "<br>Proceeding to full check-out.<br>";		 $cmd = "cvs -d " . SRC . " -z3 checkout -r " . REL . " .";		exec($cmd, $output,$return);	 }else{		 echo "<br>Codebase needs updating .<br>";		 $cmd = "cvs -z3 update . -dP  -r " . REL;		exec($cmd, $output,$return);       echo "<pre>";	   echo "Output of <b>" .$cmd . "<b>";        echo "</pre>";	 }	echo "<br><br><i><b>Congratulations!</b></i><br><br>Codebase up to date.";?>