From 3919172d27b13b70eed4d941d9e919add2547542 Mon Sep 17 00:00:00 2001 From: Alain Peyrat Date: Sat, 2 Oct 2010 15:31:56 +0000 Subject: [PATCH] Removed obsolete files --- tools/language_file_merger.php | 120 -------- tools/patchmaker.php | 611 ----------------------------------------- tools/savannah_std.class | 309 --------------------- 3 files changed, 1040 deletions(-) delete mode 100755 tools/language_file_merger.php delete mode 100755 tools/patchmaker.php delete mode 100644 tools/savannah_std.class diff --git a/tools/language_file_merger.php b/tools/language_file_merger.php deleted file mode 100755 index 7770919..0000000 --- a/tools/language_file_merger.php +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/php -q -$page) { - foreach($page AS $key => $value) { - if(!isset($targetContent[$pageName][$key])) { - fwrite($stderr, 'TO_TRANSLATE - added : '.$pageName.' '.$key."\n"); - $resultContent[$pageName][$key] = array('value' => $value['value'], 'prefix' => TO_TRANSLATE); - } else { - if($targetContent[$pageName][$key]['prefix'] == TO_TRANSLATE) { - fwrite($stderr, 'TO_TRANSLATE - updated : '.$pageName.' '.$key."\n"); - $resultContent[$pageName][$key] = array('value' => $value['value'], 'prefix' => TO_TRANSLATE); - } else { - $resultContent[$pageName][$key] = $targetContent[$pageName][$key]; - } - unset($targetContent[$pageName][$key]); - } - } -} - -reset($targetContent); -foreach($targetContent AS $pageName => $page) { - foreach($page AS $key => $value) { - fwrite($stderr, 'TO_REMOVE - added : '.$pageName.' '.$key."\n"); - $resultContent[$pageName][$key] = array('value' => $value['value'], 'prefix' => TO_REMOVE); - } -} -fclose($stderr); - -unset($targetContent); -unset($baseContent); - -arraySort($resultContent); -reset($resultContent); - -foreach($resultContent AS $pageName => $page) { - foreach($page AS $key => $value) { - echo $value['prefix'].$pageName."\t".$key."\t".$value['value']."\n"; - } -} - -function showHelp() { - global $argc, $argv; - $self = basename($argv[0]); -?> ->> GForge language file merge utility, by Hunte Swee and Guillaume Smet<< - -Usage: - 1>merge.tab 2>merge.log -Example: - /usr/share/gforge SimplifiedChinese 1>merge.tab 2>merge.log - - $val, 'prefix' => $prefix); - } - } - return $result; -} - -function &arraySort(& $array) { - $keys = array_keys($array); - for($i = 0, $count = count($keys); $i < $count; $i++) { - ksort($array[$keys[$i]]); - } - ksort($array); -} - -?> diff --git a/tools/patchmaker.php b/tools/patchmaker.php deleted file mode 100755 index 066a345..0000000 --- a/tools/patchmaker.php +++ /dev/null @@ -1,611 +0,0 @@ - Searchs for the next "Index:" line - * - * @param &array The file lines array - * @param int position in the array where this index is found - * @param int position where to begin searching from - * @param boolean Whether it´s a plugin diff or the main gforge plugin - * @param string The module name - * @param boolean true on success, false on EOF - * - */ - function searchNextIndex(&$lines,&$position,$beginfrom,$isplugin,$module) { - $i = $beginfrom; - while ( ($i Searchs for the next "Index:" line - * - * @param &array The file lines array - * @param int position in the array where the first "@@" line is found - * @param int position where to begin searching from - * @param boolean Whether it´s a plugin diff or the main gforge plugin - * @param string The module name - * @param boolean whether EOF was found instead of "@@" or "Index:" lines - * @param boolean true on success - * - */ - - function searchFirstModification(&$lines,&$firstmodposition,$beginfrom,$isplugin,$module,&$foundEOF) { - $i = $beginfrom; - $foundEOF = false; - while ( ( $i < count($lines) ) ) { - - if ($isplugin) { - //if it´s a plugin, add the plugin relative path to the file path - if (preg_match('/^--- /',$lines[$i])) { - $lines[$i] = "--- " . "plugins/" . $module . "/" . substr($lines[$i],4); - } - if (preg_match('/^\+\+\+ /',$lines[$i])) { - $lines[$i] = "+++ " . "plugins/" . $module . "/" . substr($lines[$i],4); - } - } - - if (preg_match('/^@@/',$lines[$i])) { - $firstmodposition = $i; - return true; - } - $i++; - } - $foundEOF = true; - return true; - } - - /** - * searchSecondModification -> Searchs for the next "Index:" line - * - * @param &array The file lines array - * @param int position in the array where the second "@@" line is found (if it is) - * @param int position in the array where the first "@@" line was found - * @param boolean whether a new index was found instead of a second "@@" line - * @param if $foundnewindex is true, this indicates the position where this new index has been found - * @param boolean whether EOF was found instead of "@@" or "Index:" lines - * @param boolean whether a "version" line was found in the first "@@" section - * @param int position where to begin searching from - * @param boolean Whether it´s a plugin diff or the main gforge plugin - * @param string The module name - * @param boolean true on success - * - */ - function searchSecondModification(&$lines,&$secondmodposition,$firstmodposition,&$foundnewindex,&$new_indexposition,&$foundEOF,&$foundversion,$isplugin,$module) { - $i = $firstmodposition + 1; - $foundversion = false; - $foundEOF = false; - $foundnewindex = false; - while ( ($i $lines[($i+1)] - if ( (preg_match('/@version[\s|\t]+\$Id$lines[$i])) && (preg_match('/@version[\s|\t]+\$Id$lines[$j])) ) { // only if there´s a - version and a + version (changed version) - $foundversion = true; - echo "." ; - } - if (preg_match('/^Index:/',$lines[$i])) { - $new_indexposition = $i; - $foundnewindex = true; - if ($isplugin) { - //if it´s a plugin, add the plugin relative path to the file path - $lines[$i] = "Index: " . "plugins/" . $module . "/" . substr($lines[$i],7); - } - return true; - } - $i++; - } - $foundEOF = true; - return true; - } - - /** - * parseDiffs -> read the files in the current dir and parse the .diff files - * - */ - - function parseDiffs() { - $current=getcwd(); - //open current directory for reading - $handle=opendir("."); - while ($filename = readdir($handle)) { - //Don't add special directories '..' or '.' to the list - if (($filename!='..') && ($filename!='.') && (strstr($filename,".diff") && (filesize($filename)>0))) { // only get the diff files - if (!strstr($filename,"gforge")) { - $isplugin = true; - } else { - $isplugin = false; - } - echo "Parsing file $filename ...\n"; - parseDiff($filename,$isplugin); - } - } - closedir($handle); - } - - /** - * testPatch -> simulates a patching process - * - * @param array the plugins info - * @param boolean Output the patching process? - * - * @return boolean true on success - */ - - function testPatch($plugins,$debug) { - global $old_branch_is_date,$old_branch,$cvsmodule; - - echo YELL . "Performing test of the created patch. Proceeding to update CVS to old versions...\n" . NORMAL; - //now we change the plugins to update to the old branch instead. - for ($i=0;$i just grabs the parsed diffs and joins them into 1 big file - * - */ - - function joinDiffs() { - $current=getcwd(); - //open current directory for reading - $handle=opendir("."); - echo "Creating joined file GFORGEPATCH ...\n"; - while ($filename = readdir($handle)) { - //Don't add special directories '..' or '.' to the list - if (($filename!='..') && ($filename!='.') && (strstr($filename,".diff") && (strstr($filename,"parsed-")) && (filesize($filename)>0))) { // only get the diff files - file_put_contents("GFORGEPATCH",file_get_contents($filename),FILE_APPEND); - } - } - closedir($handle); - if (is_file("GFORGEPATCH")) { - echo GREEN . "File GFORGEPATCH created...\n" . NORMAL; - } else { - echo RED . "File GFORGEPATCH couldn´t be created successfully\n" . NORMAL; - exit(); - } - } - - /** - * parseDiff -> update the plugins from cvs - * - * @param string The file name - * @param boolean Whether it´s a plugin diff or the main gforge plugin - * @param boolean true on success, false on failure - * - */ - function parseDiff($filename,$isplugin) { - if (! ($vals = file_get_contents($filename)) ){ - echo RED . "Failed to open file $filename \n" . NORMAL; - return false; - } - $lines = explode("\n",$vals); //now we have the lines in an array - for ($i=0;$i0) { - //remove the " ? filename" lines - for ($i=0;$i<$indexposition;$i++) { - $linestowrite[$i] = 0; - } - } - do { - searchFirstModification($lines,$firstmodposition,$indexposition,$isplugin,$module,$foundEOF); //search for first @@ line - //weird condition -> i found one diff that had an index and no @@... the file hadn´t been modified. the program crashed. this fixes it - if ($foundEOF) { - //ignore this last index and finish - for ($i=$indexposition;$i updates gforge and the plugins from cvs - * - * @param string Branch to update to - * @param boolean Whether the branch is a date - * @param array of plugins - * @param boolean is this a test? - * @return boolean true on success, exits on failure - * - */ - function updateAll($branch,$branch_is_date,$plugins,$test) { - global $cvsmodule,$cvsroot; - - echo "Updating to " . $branch . " branch...\n"; - - chdir ($cvsmodule); - - if ($branch_is_date) { - exec("cvs -Q -d " . $cvsroot . " update -dP -D $branch 2>>/tmp/patchmaker-errorlog",$out,$return_value); // returns 0 on success... that´s why the return_value var - } else { - exec("cvs -Q -d " . $cvsroot . " update -dP -r $branch 2>>/tmp/patchmaker-errorlog",$out,$return_value); // returns 0 on success... that´s why the return_value var - } - - if ($return_value != 0) { - die(RED . "Could not update from cvs, exiting...\n" . NORMAL); - } - - echo GREEN . "Module " . $cvsmodule . " updated successfully.\n" . NORMAL; - - if (!empty($plugins)) { - if (!is_dir('plugins')) { - if (!mkdir('plugins')) { - die(RED . "Could not create dir plugins, exiting...\n" . NORMAL); - } - echo "Dir plugins Created.\n"; - } else { - echo "Dir plugins already exists.\n"; - } - - if (!updatePlugins($plugins,!$test)) { - exit(); - } - } - return true; - } - - /** - * updatePlugins -> update the plugins from cvs - * - * @param array Plugins that will be updated - * @param boolean Whether to create the diffs or just update. True by default - * @return boolean true on success, false on failure - * - */ - function updatePlugins($plugins,$creatediffs=true) { - global $authentication,$cvsuser,$cvsserver,$cvspath; - - chdir("plugins"); - foreach ($plugins as $plugin) { - //if the plugin has different cvspath use it, else use the original one - ($plugin['cvspath'])?$path=$plugin['cvspath']:$path=$cvspath; - ($plugin['authentication'])?$auth=$plugin['authentication']:$auth=$authentication; - ($plugin['cvsuser'])?$user=$plugin['cvsuser']:$user=$cvsuser; - $cvsroot = ":" . $auth . ":" . $user . "@" . $cvsserver . ":" . $path; - - if (!(is_dir($plugin['name']))) { - //only checkout if there´s nothing in here - echo "Checking out " . $plugin['cvsmodule'] . "...\n"; - exec("cvs -Q -d " . $cvsroot . " checkout " . $plugin['cvsmodule'] . " 2>>/tmp/patchmaker-errorlog",$out,$return_value); - if ($return_value != 0) { - die(RED . "Could not checkout module " . $plugin['cvsmodule'] . " from cvs, exiting...\n" . NORMAL); - } - echo GREEN . "Module " . $plugin['cvsmodule'] . " checked out successfully.\n" . NORMAL; - //rename the dir - if (exec("mv " . $plugin['cvsmodule'] . " " . $plugin['name'])) { //mv returns 0 on succes... - die(RED . "Could not rename the dir " . $plugin['cvsmodule'] . ", exiting...\n"); - } - echo "Dir " . $plugin['cvsmodule'] . " renamed to " . $plugin['name'] . "\n"; - } else { - echo BLUE . "Module " . $plugin['cvsmodule'] . " has already been checked out before.\n" . NORMAL; - } - echo "Updating " . $plugin['name'] . " to " . $plugin['new_branch'] . " branch...\n"; - chdir ($plugin['name']); - if ($plugin['new_branch_is_date']) { - exec("cvs -Q -d " . $cvsroot . " update -dP -D " . $plugin['new_branch'] . " 2>>/tmp/patchmaker-errorlog",$out,$return_value); // returns 0 on success... that´s why the return_value var - } else { - exec("cvs -Q -d " . $cvsroot . " update -dP -r " . $plugin['new_branch'] . " 2>>/tmp/patchmaker-errorlog",$out,$return_value); // returns 0 on success... that´s why the return_value var - } - if ($return_value != 0) { - die("Could not update" . $plugin['name'] . "from cvs, exiting...\n"); - } - echo GREEN . "Module " . $plugin['name'] . " updated successfully.\n" . NORMAL; - if ($creatediffs) { - echo "Creating the diff for module " . $plugin['name'] . "...\n"; - if ($plugin['new_branch_is_date']) { - if ($plugin['old_branch_is_date']) { - exec("cvs -Q -d " . $cvsroot . " diff -BbuN -D " . $plugin['old_branch'] . " -D " . $plugin['new_branch'] . " > ../../../" . $plugin['name'] . ".diff 2>>/tmp/patchmaker-errorlog"); - } else { - exec("cvs -Q -d " . $cvsroot . " diff -BbuNr " . $plugin['old_branch'] . " -D " . $plugin['new_branch'] . " > ../../../" . $plugin['name'] . ".diff 2>>/tmp/patchmaker-errorlog"); - } - } else { - if ($plugin['old_branch_is_date']) { - exec("cvs -Q -d " . $cvsroot . " diff -BbuN -D " . $plugin['old_branch'] . " -r " . $plugin['new_branch'] . " > ../../../" . $plugin['name'] . ".diff 2>>/tmp/patchmaker-errorlog"); - } else { - exec("cvs -Q -d " . $cvsroot . " diff -BbuNr " . $plugin['old_branch'] . " -r " . $plugin['new_branch'] . " > ../../../" . $plugin['name'] . ".diff 2>>/tmp/patchmaker-errorlog"); - } - } - if ((!(file_exists("../../../".$plugin['name'].".diff"))) || ((filesize("../../../".$plugin['name'].".diff")) < 1) ){ - if ((filesize("../../../".$plugin['name'].".diff")) < 1) { - echo BLUE . "The diff for " . $plugin['name'] . " is empty... ---> " . $plugin['name'] . ".diff" . "\n" . NORMAL; - unlink("../../../" . $plugin['name'] . ".diff"); - } else { - die("Could not create the diff, exiting...\n"); - } - } else { - echo GREEN . "Diff created successfully ---> " . $plugin['name'] . ".diff" . ".\n" . NORMAL; - } - } - chdir (".."); // return to plugins dir - } - chdir (".."); //return to main module dir - return true; - } - -/* MAIN */ - -if ($only_parse_diffs) { - chdir($new_branch); - parseDiffs(); - joinDiffs(); - exit(); -} - -if ($only_test_patch) { - chdir($new_branch); - if (testPatch($plugins,$debug_patch_output)) { - echo GREEN . "GFORGEPATCH file applied successfully, you can distribute the file\n" . NORMAL ; - } else { - echo RED . "GFORGEPATCH file couldn´t be applied correctly, please check the errors and correct manually\n" . NORMAL ; - } - exit(); -} - -// get the cvs version of new branch - -echo "Creating Dir " . $new_branch . " ...\n"; - -$makedir = true; -if (is_dir(getcwd() . "/" . $new_branch)) { - echo BLUE . "Dir " . $new_branch . " already exists.\n" . NORMAL; - echo BLUE . "The files are going to be changed. Continue? (Y/N) :" . NORMAL; - $sure = fread($STDIN,1); - if ( ($sure!='y') && ($sure!='Y') ) { - die(RED . "Exiting...\n"); - } - fclose($STDIN); - $makedir = false; -} - -if ($makedir) { - if (!mkdir(getcwd() . "/" . $new_branch)) { - die(RED . "Could not create dir $new_branch, exiting...\n"); - } - echo "Dir " . $new_branch . " Created.\n"; -} - -chdir($new_branch); - -if (!(is_dir($cvsmodule))) { - //only checkout if there´s nothing in here - echo "Checking out " . $cvsmodule . "...\n"; - exec("cvs -Q -d " . $cvsroot . " checkout $cvsmodule 2>>/tmp/patchmaker-errorlog",$out,$return_value); - if ($return_value != 0) { - die("Could not checkout from cvs, exiting...\n"); - } - echo GREEN . "Module " . $cvsmodule . " checked out successfully.\n" . NORMAL; -} else { - echo BLUE . "Module " . $cvsmodule . " has already been checked out before.\n" . NORMAL; -} - -updateAll($new_branch,$new_branch_is_date,$plugins,0); - -echo "Creating the diff for module " . $cvsmodule . "...\n"; - -if ($new_branch_is_date) { - if ($old_branch_is_date) { - exec("cvs -Q -d " . $cvsroot . " diff -BbuN -D $old_branch -D $new_branch > ../$cvsmodule.diff"); - } else { - exec("cvs -Q -d " . $cvsroot . " diff -BbuNr $old_branch -D $new_branch > ../$cvsmodule.diff"); - } -} else { - if ($old_branch_is_date) { - exec("cvs -Q -d " . $cvsroot . " diff -BbuN -D $old_branch -r $new_branch > ../$cvsmodule.diff"); - } else { - exec("cvs -Q -d " . $cvsroot . " diff -BbuNr $old_branch -r $new_branch > ../$cvsmodule.diff"); - } -} - -chdir (".."); -if ((!(file_exists("$cvsmodule.diff"))) || ((filesize("$cvsmodule.diff")) < 1) ){ - if ((filesize("$cvsmodule.diff")) < 1) { - echo BLUE . "The diff for " . $cvsmodule . " is empty...in " . getcwd() . $cvsmodule . ".diff" . ".\n" . NORMAL; - } else { - die(RED . "Could not create the diff, exiting...\n" . NORMAL); - } -} else { - echo GREEN . "Diff created successfully ---> " . $cvsmodule . ".diff" . ".\n" . NORMAL; -} - -parseDiffs(); -joinDiffs(); -if (testPatch($plugins,$debug_patch_output)) { - echo GREEN . "GFORGEPATCH file applied successfully, you can distribute the file\n" . NORMAL ; -} else { - echo RED . "GFORGEPATCH file couldn´t be applied correctly, please check the errors and correct manually\n" . NORMAL ; -} - -/* END MAIN */ - -/**** END PROGRAM ****/ - -?> \ No newline at end of file diff --git a/tools/savannah_std.class b/tools/savannah_std.class deleted file mode 100644 index 65e6683..0000000 --- a/tools/savannah_std.class +++ /dev/null @@ -1,309 +0,0 @@ -Layout(); - - // The root location for images - $this->imgroot = "themes/THEMENAME/images/"; - $this->imgproj = "themes/THEMENAME/images/"; - - //Define all the icons for this theme - $this->icons = array('Summary' => 'ic/anvil24.png', - 'Homepage' => 'ic/home.png', - 'Forums' => 'ic/notes.png', - 'Bugs' => 'ic/bug.png', - 'Support' => 'ic/support.png', - 'Patches' => 'ic/patch.png', - 'Lists' => 'ic/mail.png', - 'Tasks' => 'ic/index.png', - 'Docs' => 'ic/docman.png', - 'Surveys' => 'ic/survey.png', - 'News' => 'ic/news.png', - 'CVS' => 'ic/convert.png', - 'Files' => 'ic/save.png' - ); - - $this->bgpri = array(); - - /* - Set up the priority color array one time only - */ - $bgpri[1] = 'priora'; - $bgpri[2] = 'priorb'; - $bgpri[3] = 'priorc'; - $bgpri[4] = 'priord'; - $bgpri[5] = 'priore'; - $bgpri[6] = 'priorf'; - $bgpri[7] = 'priorg'; - $bgpri[8] = 'priorh'; - $bgpri[9] = 'priori'; - } - - // Box Top, equivalent to html_box1_top() - function box1_top($title,$echoout=1,$bgcolor=''){ - $return = ' - - - - - - - - - - - - -
'.$title.'
'; - if ($echoout) { - print $return; - } else { - return $return; - } - } - - // Box Middle, equivalent to html_box1_middle() - function box1_middle($title,$bgcolor='') { - return ' -
'.$title.'
'; - } - - // Get an alternating row style for tables. - function box1_get_alt_row_style($i) { - if ($i % 2 == 0) { - return 'class=boxitem'; - } else { - return 'class=boxitemalt'; - } - } - - // Box Bottom, equivalent to html_box1_bottom() - function box1_bottom($echoout=1) { - $return = ' -
-'; - if ($echoout) { - print $return; - } else { - return $return; - } - } - - // generic_header_start() - Start a generic HTML header - function generic_header_start($params) { - - global $G_SESSION, $sys_name; - - if (!$params['title']) { - $params['title'] = $GLOBALS['sys_name']; - } else { - $params['title'] = $GLOBALS['sys_name'].": " . $params['title']; - } - ?> - - - - - - - <?php echo $params['title']; ?> - - - - - - - - - -Query Count: $QUERY_COUNT"; - echo "

$GLOBALS[G_DEBUGQUERY]"; - } - ?> -

  - - - generic_header_start($params); - - //themable someday? - $site_fonts='helvetica,sans-serif'; - - $this->generic_header_end($params); - -?> - - - - - - - - -
- - - - - - - -
-
- - -
-
- - -generic_footer($params); - } - - - - function menuhtml_top($title) { - /* - Use only for the top most menu - */ - ?> - - - - - - - - -'; - } - - function menu_entry($link, $title) { - print "\t".''.$title.'  '; - print html_image($this->imgroot . "point.png",'7','7',array('alt'=>' > ')); - print '  
'; - } - - /*! @function tab_entry - @abstract Prints out the a themed tab, used by project_tabs - @param $url is the URL to link to - $icon is the image to use (if the theme uses it) - $title is the title to use in the link tags - $selected is a boolean to test if the tab is 'selected' - @result text - echos HTML to the screen directly - */ - function tab_entry($url='http://localhost/', $icon='', $title='Home', $selected=0) { - print ' - ' . $title . ' | '; - } -} -?> -- 2.1.4