public static function getPackageData($repo, $package, $installed) { $packageName = preg_replace('/\\-[0-9a-z\\._A-Z\\+]*\\-[0-9a-z\\._A-Z\\+]*$/', '', $package); $packageDesc = PacmanData::parsePacmanDataFile(getRepoDir($repo) . $package . '/desc'); if ($packageName != $packageDesc['%NAME%'][0]) { sendMessage('integrityError', array('%p' => $packageName, '%desc_name' => $packageDesc['%NAME%'][0])); exit; } return array('dir' => $package, 'name' => $packageName, 'installed' => $installed, 'desc' => $packageDesc['%DESC%'][0], 'version' => $packageDesc['%VERSION%'][0]); }
public function updateFileList() { //$this->file_list=array(); if ($this->verification != $GLOBALS['data']->verification['local']) { $file_list_copy = $this->file_list; foreach ($GLOBALS['data']->installed_packages as $packageName => $packageData) { if ($this->file_list[$packageName]) { if ($this->file_list[$packageName]['version'] != $packageData['version']) { // Update $this->file_list[$packageName] = PacmanData::parsePacmanDataFile($GLOBALS['pacman_directory'] . 'local/' . $packageData['dir'] . '/files'); $packageFiles = $this->file_list[$packageName]['%FILES%']; $files_count = count($packageFiles); for ($i = 0; $i < $files_count; $i++) { eval('$packageFiles[$i]="/' . str_replace(array('?', '$'), array('\\?', '\\$'), $packageFiles[$i]) . '";'); } $this->file_list[$packageName]['%FILES%'] = $packageFiles; $this->file_list[$packageName]['version'] = $packageData['version']; } } else { // Add $this->file_list[$packageName] = PacmanData::parsePacmanDataFile($GLOBALS['pacman_directory'] . 'local/' . $packageData['dir'] . '/files'); $packageFiles = $this->file_list[$packageName]['%FILES%']; $files_count = count($packageFiles); for ($i = 0; $i < $files_count; $i++) { eval('$packageFiles[$i]="/' . str_replace(array('?', '$'), array('\\?', '\\$'), $packageFiles[$i]) . '";'); } $this->file_list[$packageName]['%FILES%'] = $packageFiles; $this->file_list[$packageName]['version'] = $packageData['version']; } unset($file_list_copy[$packageName]); } if (count($file_list_copy)) { foreach ($file_list_copy as $packageName => $filesData) { unset($this->file_list[$packageName]); } } $this->verification = $GLOBALS['data']->verification['local']; Std::write($GLOBALS['tupac_directory'] . '/tupac_filelist', serialize($this)); chmod($GLOBALS['tupac_directory'] . '/tupac_filelist', 0666); } }
<?php /* * Created on 23/05/2008 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ $GLOBALS['tupacrc'] = getPipeContents('echo -n $HOME') . '/.tupacrc'; if (file_exists($GLOBALS['tupacrc'])) { $GLOBALS['tupacrcData'] = PacmanData::parsePacmanDataFile($GLOBALS['tupacrc']); } #error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); $a = array(0, 1, 2); function getRepoDir($repo) { return $GLOBALS['pacman_directory'] . ($repo == 'local' ? '' : 'sync/') . $repo . '/'; } function getRepoDirList() { $directories = array(); $directories[] = 'local'; $dh = opendir($GLOBALS['pacman_directory'] . 'sync/'); while (false !== ($dir = readdir($dh))) { $directories[] = $dir; } closedir($dh); return $directories; } define('BLACK', "[0;30m"); define('RED', "[0;31m");