function copyFiles($sd, $dd) { global $fs; foreach ($fs->ls($sd) as $fn) { $sfp = PathUtil::rel($sd, $fn); $dfp = PathUtil::rel($dd, $fn); //print "copy $sfp $dfp<BR>\n"; if ($fs->isDir($sfp)) { copyFiles($sfp, $dfp); } else { $fs->setContent($dfp, $fs->getContent($sfp)); } } }
function copyFiles($src, $dst) { $dir = opendir($src); if (!is_dir($dst)) { mkdir($dst, PER_FOLDER) or die("Mkdir problem: " . $dst); } while (false !== ($file = readdir($dir))) { if ($file != '.' && $file != '..') { if (is_dir($src . '/' . $file)) { copyFiles($src . '/' . $file, $dst . '/' . $file); chmodAll($dst . '/' . $file, PER_FILE); } else { copy($src . '/' . $file, $dst . '/' . $file) or die("Copy problem: " . $src . '/' . $file . " -> " . $dst . '/' . $file); chmodAll($dst . '/' . $file, PER_FILE); } } } closedir($dir); }
function copyFiles($src, $dst) { if (file_exists($dst)) { removeDir($dst); } if (is_dir($src)) { mkdir($dst); $files = scandir($src); foreach ($files as $file) { if ($file != "." && $file != "..") { copyFiles("{$src}/{$file}", "{$dst}/{$file}"); } } } else { if (file_exists($src)) { copy($src, $dst); removeDir($src); } } }
function installQubit($qubitWebRoot, $qubitDataRoot) { global $fileSystemPathToWebFiles; global $fileSystemPathToDataFiles; // Verify that $fileSystemPathToWebFiles and $fileSystemPathToDataFiles exist. Don't bother // reporting if they are found. if (!file_exists($fileSystemPathToWebFiles)) { reportOnProgress("Verifying location of source files", 'Problem', "Can't find {$fileSystemPathToWebFiles}", "Verify that '{$fileSystemPathToWebFiles}' exists"); $error = true; } if (!file_exists($fileSystemPathToDataFiles)) { reportOnProgress("Verifying location of source files", 'Problem', "Can't find {$fileSystemPathToDataFiles}", "Verify that '{$fileSystemPathToDataFiles}' exists"); $error = true; } // If there are errors, return here since we can't go any further, and we don't want to copy any files. // return $error; // If we made it this far, copy files needed to install Qubit $error = copyFiles($fileSystemPathToWebFiles, $qubitWebRoot, 'web'); $error = copyFiles($fileSystemPathToDataFiles, $qubitDataRoot, 'data'); // Write out index.php controller file $error = writeIndexPhp($qubitWebRoot . 'index.php', $qubitDataRoot . 'lib/QubitConfiguration.class.php'); // Populate db with structure and sample data. We use Symfony's sfPropelInsertSqlTask() and // sfPropelLoadDataTask() objects to do this. To do: Trap errors here and report them with // reportOnProgress(). // First, include Symfony config flass, initialize objects require_once $qubitDataRoot . 'lib/QubitConfiguration.class.php'; $configuration = new QubitConfiguration('dev', true); $dispatcher = new sfEventDispatcher(); $formatter = new sfAnsiColorFormatter(); // We need to chdir into the data directory or symfony complains chdir($qubitDataRoot); // Next, copy template for propel.ini and call a symphony task to populate it and databases.yml $error = copyPropelIni($qubitDataRoot . 'config/propel.ini.tmpl', $qubitDataRoot . 'config/propel.ini'); $error = writeDatabaseConfigFiles($dispatcher, $formatter); // Then, perform SQL tasks. We're no longer checking for $error here, but the user will see errors // if these tasks generate any. $insertSql = new sfPropelInsertSqlTask($dispatcher, $formatter); $insertSql->run(); $loadData = new sfPropelLoadDataTask($dispatcher, $formatter); $loadData->run(array('qubit')); // To do: Perform check to see if mod_rewrite is enabled. We do this by issuing an fopen to a Qubit URL return $error; }
$cache = setupGitCacheFolder($folders); } define('GIT_CACHE_DEST', $cache[0]); if (0 == errorCount()) { for ($x = 0; $x < count($folders); $x++) { buildFilesList($cache, $files_list, GIT, $exclude_files, $folders[$x]); } } if (0 == errorCount() && $cache[1] == GITNEW) { downloadFiles($files_list); } if (0 == errorCount()) { backupFiles($tmp_folder, $files_list); } if (0 == errorCount()) { copyFiles($files_list); } if (0 == errorCount()) { $dbupdate = updateDB($nuConfigDBHost, $nuConfigDBName, $nuConfigDBUser, $nuConfigDBPassword); } if (errorCount() > 0) { $finalResult['message'] = 'ERRORS'; } else { $finalResult['message'] = 'SUCCESS'; } $successCount = count($success); $finalResult['errors'] = $errors; $finalResult['success'] = array("{$successCount} File(s) updated"); $finalResult['cache'] = $cache; $finalResult['dbupdate'] = $dbupdate; $json = json_encode($finalResult);
/** * Copy specified files. * * @param array $files * @param string $src_dir * @param string $des_dir * @return int */ function copyFiles(array $files, $src_dir, $des_dir) { foreach ($files as $i => $file) { if (is_array($file)) { $dir = $des_dir . DIRECTORY_SEPARATOR . $i; if (!file_exists($dir)) { mkdir($dir); } $b = copyFiles($file, $src_dir . DIRECTORY_SEPARATOR . $i, $dir); if ($b !== 0) { return 1; } } else { if (file_exists($src_dir . DIRECTORY_SEPARATOR . $file)) { $b = copy($src_dir . DIRECTORY_SEPARATOR . $file, $des_dir . DIRECTORY_SEPARATOR . $file); if (!$b) { echo "Copy {$file} failed!\n"; return 1; } } else { echo "{$file} does not exists!\n"; return 1; } } } return 0; }
exit; } if (isset($_GET["UpdateUtilityStartTask"])) { UpdateUtility_run(); exit; } if (isset($_GET["dmesg"])) { dmesg(); exit; } if (isset($_GET["artica-cron-tasks"])) { artica_cron_tasks(); exit; } if (isset($_GET["copyFiles"])) { copyFiles(); exit; } if (isset($_GET["DeleteFiles"])) { DeleteFiles(); exit; } if (isset($_GET["port-list"])) { ports_list(); exit; } if (isset($_GET["CleanCacheMem"])) { CleanCacheMem(); exit; } if (isset($_GET["files-descriptors"])) {
#!/usr/bin/env php <?php require $_SERVER['PWD'] . '/.git/hooks/utils.php'; $config = config(); $files = files(); $tmp = copyFiles($files); if (empty($tmp['files'])) { echo "No files to check\n"; exit(0); } if ($tmp['dir'] && !is_dir($tmp['dir'])) { echo "{$tmp['dir']} doesn't exist\n"; exit(1); } $config = $config['js']['lint']; $status = 0; foreach ($tmp['files'] as $file) { if (!preg_match($config['pattern'], $file)) { continue; } $cmd = "jslint -p " . escapeshellarg($file); $output = array(); echo "{$cmd}\n"; exec($cmd, $output, $return); if ($return) { echo implode("\n", $output), "\n"; $status = 1; } } exit($status);
$err = $ERR_FILE_NOT_FOUND; break; } if (!file_exists($assetsLCL . arg("target"))) { $ret = createDirs($assetsLCL . arg("target")); if (!$ret) { $err = $ERR_FILE_PERMISSION; break; } } $ret = deleteFiles($assetsLCL . arg("target")); if (!$ret) { $err = $ERR_FILE_PERMISSION; break; } $ret = copyFiles($assetsLCL . arg("path"), $assetsLCL . arg("target")); if (!$ret) { $err = $ERR_FILE_PERMISSION; break; } break; case "spider": $ret = spider($assetsLCL . arg("path"), $assetsLCL); if (!$ret) { $err = $ERR_FILE_NOT_FOUND; } break; case "touch": if (!in_array(auth_get_class(), array("admin", "supervisor", "dirprod"))) { $err = $ERR_PERMISSION; break;
die("Failed to copy {$srcfile} to {$destfile}\n"); } } } } // grab project name from cwd $proj = basename(getcwd()); // first line: $proj ver. VERSION $readme = file('readme.txt'); if (1 != preg_match('/' . $proj . ' ver\\. (.+)\\s/', $readme[0], $m)) { die("Version grab from readme.txt failed"); } $ver = trim($m[1]); // target dir for package $basedir = "{$proj}-{$ver}/"; mkdirR($basedir); // package files listed in package.lst $files = file('package.lst'); foreach ($files as $file) { $file = str_replace('\\', '/', trim($file)); $dst = $basedir; $dirname = dirname($file); if ($dirname != '.') { $dst .= $dirname; mkdirR($dst); } //echo $dst."\n"; copyFiles($file, $dst); } chdir($basedir); system("pkzip -add -dir {$proj}-{$ver}.zip");
function copyFiles($source, $dest) { global $bfolder; global $bcopy; if (strlen($source) == '') { return; } if (substr($source, strlen($source) - 1) == '/') { $source = substr($source, 0, strlen($source) - 1); } //print("Copy: $source = $dest \n"); // -- build file names to copy if (is_dir($source)) { $handle = opendir($source); while ($filename = readdir($handle)) { if ($filename != "." && $filename != "..") { $tmp = split('/', $source); $bcopy[$dest . "/" . $tmp[count($tmp) - 1]] = '^^create_dir~~'; copyFiles($source . "/" . $filename, $dest . "/" . $tmp[count($tmp) - 1]); } } closedir($handle); } else { $bcopy[$source] = $dest . "/" . basename($source); } }
function copyFiles($source, $suffixes, $dest_dir) { if (!is_dir($dest_dir)) { mkdir($dest_dir); } $files = array(); $files = array_merge($files, searchFiles($source, $suffixes)); foreach ($files as $file) { if (is_dir("{$source}/{$file}")) { copyFiles("{$source}/{$file}", $suffixes, "{$dest_dir}/{$file}"); } else { copy("{$source}/{$file}", "{$dest_dir}/{$file}"); } } }
echo "Deleting " . $buildRoot . "/sample ..\n"; delTree($buildRoot . "/sample"); } mkdir($buildRoot . "/sample"); //Create the required directories and files for the web application. copyFiles("common", $buildRoot, $srcRoot); copyFiles("controllers", $buildRoot, $srcRoot); copyFiles("public", $buildRoot, $srcRoot); // Copy composer.json file_exists copy($buildRoot . "/composer.json", $buildRoot . "/sample/composer.json"); //copy config files. if (file_exists($buildRoot . "/config")) { echo "Deleting " . $buildRoot . "/config ..\n"; delTree($buildRoot . "/config"); } copyFiles("config", $buildRoot, $srcRoot, TRUE); // Delete vendor directory if it exists. if (file_exists($buildRoot . "/sample/vendor")) { echo "Deleting " . $buildRoot . "/sample/vendor...\n"; delTree($buildRoot . "/sample/vendor"); } // Execute composer install if vendor directory does not exist. if (file_exists($buildRoot . "/sample/vendor")) { echo "Deleting " . $buildRoot . "/sample/vendor...\n"; delTree($buildRoot . "/sample/vendor"); } echo "Executing Composer Install...\n"; $output = `composer -d=build/sample install`; echo $output; echo "Build Successfull!\n"; exit(1);
/** * \brief Config fossology * * @param object $objRef an object reference (should be to ConfigSys) * * @return boolean */ function configFossology($objRef) { if (!is_object($objRef)) { return FALSE; } $debLog = NULL; $installLog = NULL; //echo "DB: IFOSS: osFlavor is:$objRef->osFlavor\n"; switch ($objRef->osFlavor) { case 'Ubuntu': case 'Debian': $debApache = "ln -s /usr/local/etc/fossology/conf/src-install-apache-example.conf /etc/apache2/sites-enabled/fossology.conf"; $last = exec($debApache, $out, $rtn); //echo "last is:$last\nresults of update are:\n";print_r($out) . "\n"; if ($rtn != 0) { echo "Failed to config fossology!\nTranscript is:\n"; echo implode("\n", $out) . "\n"; return FALSE; } break; case 'Fedora': case 'RedHat': $initPostgres = "service postgresql initdb"; $startPostgres = "service postgresql start"; $restartPostgres = "service postgresql restart"; $psqlFile = "../dataFiles/pkginstall/redhat/6.x/pg_hba.conf"; echo "** Initial postgresql **\n"; $last = exec($initPostgres, $out, $rtn); if ($rtn != 0) { echo "Failed to initial postgresql!\nTranscript is:\n"; echo implode("\n", $out) . "\n"; return FALSE; } echo "** Start postgresql **\n"; $last = exec($startPostgres, $out, $rtn); if ($rtn != 0) { echo "Failed to start postgresql!\nTranscript is:\n"; echo implode("\n", $out) . "\n"; return FALSE; } echo "** Configure pg_hba.conf **\n"; try { copyFiles($psqlFile, "/var/lib/pgsql/data/"); } catch (Exception $e) { echo "Failure: Could not copy postgres config files\n"; } $last = exec($restartPostgres, $out, $rtn); if ($rtn != 0) { echo "Failed to restart postgresql!\nTranscript is:\n"; return FALSE; } break; default: echo "FATAL! Unrecongnized OS/Release, not one of Ubuntu, Debian, RedHat" . " or Fedora\n"; return FALSE; break; } return TRUE; }
foreach ($domains as $domain) { $delete .= ' AND ids.domainID!="' . $domain . '"'; } $qD = $db->query('SELECT def.moduleName, domain.name, ids.ID FROM cms_modules_def as def LEFT JOIN cms_domains_ids as ids ON def.ID=ids.elementID LEFT JOIN cms_domains as domain ON ids.domainID=domain.ID WHERE def.ID="' . $id . '" AND ids.type="mod" ' . $delete . ''); while ($rD = $db->fetch($qD)) { $db->query("DELETE FROM cms_domains_ids WHERE elementID='" . $id . "' AND type='mod'"); recursive_remove_directory('../../modules/' . $rD['name'] . '/' . $rD['moduleName'] . '/'); } //Add $moduleData = $db->get($db->query('SELECT moduleName FROM cms_modules_def WHERE ID="' . $id . '"')); foreach ($domains as $domain) { $qA = $db->rows($db->query('SELECT ID FROM cms_domains_ids WHERE domainID="' . $domain . '" AND elementID="' . $id . '" AND type="mod" ')); if ($qA == 0) { $nameD = $db->get($db->query('SELECT name FROM cms_domains WHERE ID="' . $domain . '"')); if (!is_dir('../../modules/' . $nameD['name'] . '/' . $moduleData['moduleName'] . '')) { copyFiles('../../modules/default/' . $moduleData['moduleName'] . '/', '../../modules/' . $nameD['name'] . '/' . $moduleData['moduleName'] . '/'); chmodAll('../../modules/' . $nameD['name'] . '/' . $moduleData['moduleName'] . '/'); } $files = scandir('../../modules/default/images/'); foreach ($files as $file) { if (strlen($file) > 2) { if (!is_file('../../modules/' . $nameD['name'] . '/images/' . $file)) { copy('../../modules/default/images/' . $file, '../../modules/' . $nameD['name'] . '/images/' . $file); chmod('../../modules/' . $nameD['name'] . '/images/' . $file, PER_FILE); } } } $db->query("INSERT INTO cms_domains_ids (elementID,domainID,type) VALUES ('" . $id . "','" . $domain . "','" . $db->filter('ver') . "')"); } } echo 'ok';
function pasteFiles() { if ($_SESSION["copy"] == 1) { copyFiles(); } else { moveFiles(); } }
d('# Dependencies'); $result->composer = copyDependencyToBuild('/composer'); i($result->composer, 'composer'); $result->o80 = copyDependencyToBuild('/o80/i18n/src'); i($result->o80, 'o80-i18n'); $result->smarty = copyDependencyToBuild('/smarty/smarty/libs'); i($result->smarty, 'smarty'); $result->autoload = @copy(VENDOR . '/autoload.php', BUILD_VENDOR . '/autoload.php'); i($result->autoload, 'autoload'); // Copy assets d('# Assets'); copyFiles(array('css', 'fonts', 'images', 'js'), $result); // Copy sources d('# Source directories'); copyFiles(array('admin', 'app', 'locale', 'tpl'), $result); d('# Source files'); $files = array('adminstuds.php', 'bandeaux.php', 'create_classic_poll.php', 'create_date_poll.php', 'create_poll.php', 'exportcsv.php', 'favicon.ico', 'htaccess.txt', 'index.php', 'INSTALL.md', 'LICENCE.fr.txt', 'LICENSE.en.txt', 'maintenance.php', 'php.ini', 'README.md', 'robots.txt', 'studs.php'); copyFiles($files, $result); // Zip Dist $output = DIST . '/framadate-' . VERSION . '-' . date('Ymd') . '.zip'; zip(BUILD, $output); rrmdir(BUILD); if (isset($_GET['verbose'])) { var_dump($result); } d('--------'); d('Distribution file: ' . realpath($output)); $generatedIn = round(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], 4); d('========'); d('Generated in: ' . $generatedIn . ' secondes'); echo '</pre>';
function csvParsing($src, $file) { global $distributorConfig, $checkMrp; $result = ''; $updateResult = ''; $isInserted = false; $processedFolder = $distributorConfig['processedDir']; $defaults = array('length' => 0, 'delimiter' => ',', 'enclosure' => '"', 'escape' => '\\', 'headers' => true, 'text' => false); $fields = array(); $options = array(); $options = array_merge($defaults, $options); if (($handle = fopen("{$src}/{$file}", "r")) !== FALSE) { if (empty($fields)) { // read the 1st row as headings $fields = fgetcsv($handle, $options['length'], $options['delimiter'], $options['enclosure']); } // return the messages while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $rowData = array(); foreach ($data as $row) { array_push($rowData, addslashes($row)); } $itemKeyValues = array_combine($fields, $rowData); if ($checkMrp) { if (isMrpEmpty($itemKeyValues)) { createMrpException($itemKeyValues); continue; } } if ($distributorConfig['isForceInsert']) { $result = saveCSVData($itemKeyValues); } else { $updateResult = mappingItemWithDistributor($itemKeyValues); } if ($result || $updateResult) { $isInserted = true; } else { $isInserted = false; } } if ($isInserted) { copyFiles($file, $src, $processedFolder); } fclose($handle); return; } }
* You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @copyright Copyright (c) 2007 Collaborative Software Initiative (CSI) * @license http://www.gnu.org/licenses/ GNU General Public License v3 */ echo "\n"; // change to the root directory of the application chdir(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'); // setup (generate necessary filenames, etc) $version = $_SERVER['argc'] > 1 ? "-{$_SERVER['argv'][1]}" : ''; $profile = $_SERVER['argc'] > 2 ? "{$_SERVER['argv'][2]}" : null; $appName = $profile !== null ? $profile : 'qframe'; $basename = basename(getcwd()); // copy files if (!copyFiles($appName)) { cleanup($appName); die(formatMessage("== Packaging FAILED (copying files) ", '=')); } // replace copied files with files from the selected package profile if (!replace($profile)) { cleanup($appName); die(formatMessage("== Packaging FAILED (profile replace) ", '=')); } // package up the remaining files (sans excluded files) if (!package($appName, $version)) { cleanup($appName); die(formatMessage("== Packaging FAILED (packaging) ", '=')); } // clean up after ourselves cleanup($appName);
function copyParentFiles() { global $motopressSettings; global $isSupportedTheme; global $theme; $errors = array(); if ($isSupportedTheme) { $parent = $theme->parent(); if ($parent) { //if child theme $skip = array('.', '..'); $parentPath = $motopressSettings['theme_root'] . '/' . $parent->get_stylesheet(); $parentFiles = array_diff(scandir($parentPath), $skip); $childPath = $motopressSettings['theme_root'] . '/' . $motopressSettings['current_theme']; $childFiles = array_diff(scandir($childPath), $skip); $skippedFiles = array('comments', 'filterable-portfolio-loop', 'footer', 'functions', 'header', 'options', 'searchform', 'sidebar', 'slider', 'title'); $patternTemplates = '/^(?!^' . implode('|^', $skippedFiles) . ').+\\.php$/is'; $parentTemplates = preg_grep($patternTemplates, $parentFiles); $childTemplates = preg_grep($patternTemplates, $childFiles); $diffTemplates = array_diff($parentTemplates, $childTemplates); if (!empty($diffTemplates)) { copyFiles($diffTemplates, $parentPath, $childPath, $errors); } //wrapper $parentWrapperPath = $motopressSettings['theme_root'] . '/' . $parent->get_stylesheet() . '/wrapper'; $childWrapperPath = $motopressSettings['theme_wrapper_root']; $diffWrapperFiles = getDiffFiles($parentWrapperPath, $childWrapperPath, $skip, $errors); if (!empty($diffWrapperFiles)) { copyFiles($diffWrapperFiles, $parentWrapperPath, $childWrapperPath, $errors); } //static $parentStaticPath = $motopressSettings['theme_root'] . '/' . $parent->get_stylesheet() . '/static'; $childStaticPath = $motopressSettings['theme_static_root']; $diffStaticFiles = getDiffFiles($parentStaticPath, $childStaticPath, $skip, $errors); if (!empty($diffStaticFiles)) { copyFiles($diffStaticFiles, $parentStaticPath, $childStaticPath, $errors); } //loop /* $parentLoopPath = $motopressSettings['theme_root'] . '/' . $parent->get_stylesheet() . '/loop'; $childLoopPath = $motopressSettings['theme_loop_root']; $diffLoopFiles = getDiffFiles($parentLoopPath, $childLoopPath, $skip, $errors); if (!empty($diffLoopFiles)) { copyFiles($diffLoopFiles, $parentLoopPath, $childLoopPath, $errors); } */ //woo $parentWooPath = $motopressSettings['theme_root'] . '/' . $parent->get_stylesheet() . '/woocommerce'; $childWooPath = $motopressSettings['theme_root'] . '/' . $motopressSettings['current_theme'] . '/woocommerce'; $diffWooFiles = getDiffFiles($parentWooPath, $childWooPath, $skip, $errors); if (!empty($diffWooFiles)) { copyFiles($diffWooFiles, $parentWooPath, $childWooPath, $errors); } } } return $errors; }
mkdir('../../modules/' . $name, PER_FOLDER); chmod('../../modules/' . $name, PER_FOLDER); mkdir('../../modules/' . $name . '/images', PER_FOLDER); chmod('../../modules/' . $name . '/images', PER_FOLDER); //off mkdir('../../off/' . $name, PER_FOLDER); chmod('../../off/' . $name, PER_FOLDER); copyFiles('../../off/default', '../../off/' . $name); //block mkdir('../../block/' . $name, PER_FOLDER); chmod('../../block/' . $name, PER_FOLDER); copyFiles('../../block/default', '../../block/' . $name); //block mkdir('../../404/' . $name, PER_FOLDER); chmod('../../404/' . $name, PER_FOLDER); copyFiles('../../404/default', '../../404/' . $name); //images mkdir('../../images/' . $name, PER_FOLDER); chmod('../../images/' . $name, PER_FOLDER); mkdir('../../images/' . $name . '/article', PER_FOLDER); chmod('../../images/' . $name . '/article', PER_FOLDER); //storage mkdir('../../storage/' . $name, PER_FOLDER); chmod('../../storage/' . $name, PER_FOLDER); mkdir('../../storage/' . $name . '/Documents', PER_FOLDER); chmod('../../storage/' . $name . '/Documents', PER_FOLDER); mkdir('../../storage/' . $name . '/Flash', PER_FOLDER); chmod('../../storage/' . $name . '/Flash', PER_FOLDER); mkdir('../../storage/' . $name . '/Images', PER_FOLDER); chmod('../../storage/' . $name . '/Images', PER_FOLDER); mkdir('../../storage/' . $name . '/Documents/Pdf', PER_FOLDER);
/** * \brief config yum on a redhat based system to install fossology. * * Copies the Yum configuration file for fossology to * * @param object $objRef, a reference to the ConfigSys object * * @return boolean */ function configYum($objRef) { if (!is_object($objRef)) { return FALSE; } if (empty($objRef->yum)) { echo "FATAL, no yum install line to install\n"; return FALSE; } $RedFedRepo = 'redfed-fossology.repo'; // name of generic repo file. // replace the baseurl line with the current one. $n = "../dataFiles/pkginstall/" . $RedFedRepo; $fcont = file_get_contents($n); //if(!$fcont); //{ //echo "FATAL! could not read repo file $n\n"; //exit(1); //} //echo "DB: contents is:\n$fcont\n"; $newRepo = preg_replace("/baseurl=(.*)?/", 'baseurl=' . $objRef->yum, $fcont, -1, $cnt); // write the file, fix below to copy the correct thing... if (!($written = file_put_contents("../dataFiles/pkginstall/" . $RedFedRepo, $newRepo))) { echo "FATAL! could not write repo file {$RedFedRepo}\n"; exit(1); } // coe plays with yum stuff, check if yum.repos.d exists and if not create it. if (is_dir('/etc/yum.repos.d')) { copyFiles("../dataFiles/pkginstall/" . $RedFedRepo, '/etc/yum.repos.d/fossology.repo'); } else { // create the dir and then copy if (!mkdir('/etc/yum.repos.d')) { echo "FATAL! could not create yum.repos.d\n"; return FALSE; } copyFiles("../dataFiles/pkginstall/" . $RedFedRepo, '/etc/yum.repos.d/fossology.repo'); } //print_r($objRef); if ($objRef->osFlavor == 'RedHat') { $last = exec("yum -y install wget", $out, $rtn); if ($rtn != 0) { echo "FATAL! install EPEL repo fail\n"; echo "transcript is:\n"; print_r($out) . "\n"; return FALSE; } /* comment out the epel repo installation $last = exec("wget -e http_proxy=http://web-proxy.cce.hp.com:8088 http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm", $out, $rtn); if($rtn != 0) { echo "FATAL! install EPEL repo fail\n"; echo "transcript is:\n";print_r($out) . "\n"; return(FALSE); } $last = exec("rpm -ivh epel-release-6-8.noarch.rpm", $out, $rtn); if($rtn != 0) { echo "FATAL! install EPEL repo fail\n"; echo "transcript is:\n";print_r($out) . "\n"; return(FALSE); }*/ $last = exec("yum -y install php-phpunit-PHPUnit", $out, $rtn); if ($rtn != 0) { echo "FATAL! install PHPUnit fail\n"; echo "transcript is:\n"; print_r($out) . "\n"; return FALSE; } } return TRUE; }
$changed[] = $file; } } else { $removed[] = $file; } } foreach ($v2 as $file => $hash) { if (!isset($v1[$file])) { $new[] = $file; } } echo "Files that were removed:\n"; foreach ($removed as $file) { echo "\t{$file}\n"; } echo "\nFiles that were changed:\n"; foreach ($changed as $file) { echo "\t{$file}\n"; } echo "\nFiles introduced in the new version:\n"; foreach ($new as $file) { echo "\t{$file}\n"; } if (isset($options["w"])) { echo "\nCreating incremental structure (files will be overwritten)...\n"; copyFiles($changed, "incremental", $options["n"]); copyFiles($new, "incremental", $options["n"]); copyFiles(array("META-INF/com/android/metadata", "META-INF/com/google/android/update-binary"), "incremental", $options["n"]); createUpdaterScript($removed, "incremental"); } echo "Done.\n";