diff options
Diffstat (limited to 'shared/classes/gentoo_profile.php')
-rw-r--r-- | shared/classes/gentoo_profile.php | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/shared/classes/gentoo_profile.php b/shared/classes/gentoo_profile.php index d7726f8..d41497b 100644 --- a/shared/classes/gentoo_profile.php +++ b/shared/classes/gentoo_profile.php @@ -15,12 +15,6 @@ class sql_gentoo_profile extends sql_row_obj { 'default' => '', 'unique' => true ), - 'stage3' => array ( - 'type' => 'VARCHAR', - 'length' => 255, - 'not_null' => true, - 'default' => '' - ), 'name' => array ( 'type' => 'VARCHAR', 'length' => 255, @@ -171,30 +165,6 @@ class sql_gentoo_profile extends sql_row_obj { if ($update) query('DELETE FROM `gentoo_pkgsets` WHERE `profile`='.$this->id.($exists?' AND `id` NOT IN ('.implode(',', $exists).')':'')); } - public function read_stage3($update=false) { - global $S; - if ($update) { - query('DELETE FROM `gentoo_basepkgs` WHERE `profile`='.$this->id); - query('DELETE FROM `gentoo_baseinit` WHERE `profile`='.$this->id); - } - $file=realpath(CACHE.'/stage3/'.$this->stage3); - if (!is_readable($file)) return false; - $opt='-tv'.(substr($file, -3) == 'bz2'?'j':'z').'f'; - $prefix='./var/db/pkg/'; - $files=explode("\n", is_readable("$file.CONTENTS")?file_get_contents("$file.CONTENTS"):shell_exec('tar '.$opt.' '.escapeshellarg($file))); - if (!is_file("$file.CONTENTS")) - file_put_contents("$file.CONTENTS", implode("\n", $files)); - foreach ($files as $file) { - if (preg_match('#^[^.]+\./var/db/pkg/(.*/.*)/$#', $file, $match)) { - $pkg=new sql_gentoo_basepkg($this->id, $match[1]); - $pkg->write(); - } elseif (preg_match('#^[^.]+\./etc/runlevels/([^/]+)/([^/]+) -> /etc/init\.d/#', $file, $match)) { - $init=new sql_gentoo_baseinit($this->id, $match[2], $match[1]); - $init->write(); - } - } - return true; - } public function &get_packages($omit_masked=false, $trim=null) { global $S; $skip_masked=!in_array('masked', $trim); @@ -214,5 +184,13 @@ class sql_gentoo_profile extends sql_row_obj { $arch=ltrim($arch[0], '~'); return $arch; } + function is_hardened() { + $profile=$this->get_headers(); + $profile=$profile['profile']; + return (strpos(strtolower($profile), 'hardened') !== false); + } + function get_identifier() { + return ($this->is_hardened()?'hardened-':'').$this->get_arch(); + } } ?> |