diff options
author | Eudyptula <eitan@mosenkis.net> | 2009-06-19 14:23:12 -0400 |
---|---|---|
committer | Eudyptula <eitan@mosenkis.net> | 2009-06-19 14:23:12 -0400 |
commit | 5494492326fe0f7ea6127cfeaa1858e3c03a7da0 (patch) | |
tree | f7ce84b76ef22067270a75bb63bb2d3f5d88ee87 /shared | |
parent | Updated todo (diff) | |
download | ingenue-5494492326fe0f7ea6127cfeaa1858e3c03a7da0.tar.gz ingenue-5494492326fe0f7ea6127cfeaa1858e3c03a7da0.tar.bz2 ingenue-5494492326fe0f7ea6127cfeaa1858e3c03a7da0.zip |
Transitioned to support multiple profiles, chosen in the frontend, to use data in Packages file header, began restructuring of frontend build creator
Diffstat (limited to 'shared')
-rw-r--r-- | shared/classes/buildopt.php | 20 | ||||
-rw-r--r-- | shared/classes/profile.php | 28 | ||||
-rw-r--r-- | shared/config.php | 3 | ||||
-rw-r--r-- | shared/functions/get_pkgdirs.php | 18 |
4 files changed, 69 insertions, 0 deletions
diff --git a/shared/classes/buildopt.php b/shared/classes/buildopt.php new file mode 100644 index 0000000..e05192b --- /dev/null +++ b/shared/classes/buildopt.php @@ -0,0 +1,20 @@ +<?php +class sql_buildopt extends sql_row_obj { + protected $table='buildopts', $columns=array( + 'build' => array ( + 'type' => 'CHAR', + 'length' => 6, + 'not_null' => true + ), + 'name' => array ( + 'type' => 'VARCHAR', + 'length' => 255, + 'not_null' => true + ), + 'value' => array ( + 'type' => 'TEXT' + ) + + ); +} +?> diff --git a/shared/classes/profile.php b/shared/classes/profile.php new file mode 100644 index 0000000..b528b47 --- /dev/null +++ b/shared/classes/profile.php @@ -0,0 +1,28 @@ +<?php +class sql_profile extends sql_row_obj { + protected $table='profiles', $primary_key='pkgdir', $columns=array( + 'pkgdir' => array ( + 'type' => 'VARCHAR', + 'length' => 255, + 'not_null' => true + ), + 'name' => array ( + 'type' => 'VARCHAR', + 'length' => 255, + 'not_null' => true, + 'unique' => true + ), + 'order' => array ( + 'type' => 'TINYINT', + 'length' => 4, + 'not_null' => true + ), + 'flags' => array ( + 'type' => 'VARCHAR', + 'length' => 255, + 'not_null' => true + ) + + ); +} +?> diff --git a/shared/config.php b/shared/config.php index 12298ec..1eeb4ee 100644 --- a/shared/config.php +++ b/shared/config.php @@ -11,4 +11,7 @@ $conf['sessionlength']=1814400; // Time in seconds before sessions are purged $conf['timezone']=10800; // Time difference in seconds between UTC and the default timezone $conf['mod_rewrite']=true; // Use mod_rewrite for pretty URLs $conf['check_email_dns']=true; // Use DNS to check the domain of submitted emails for validity +$conf['pkgdir_root']='/home/eitan/soc/tinderbox'; // The directory to recursively search for pkgdirs in +$conf['emerge_default_opts']='-t -K --color=n --root-deps=rdeps'; // DON'T CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING +$conf['portdir']='/usr/portage'; // The directory conatining the portage tree to use (/usr/portage unless you have a reason to think otherwise) ?> diff --git a/shared/functions/get_pkgdirs.php b/shared/functions/get_pkgdirs.php new file mode 100644 index 0000000..1f39420 --- /dev/null +++ b/shared/functions/get_pkgdirs.php @@ -0,0 +1,18 @@ +<?php +function get_pkgdirs($dir=null) { + global $conf; + if ($dir===null) { + $dir=$conf['pkgdir_root']; + } + if (is_file($dir.'/Packages')) { + // We assume that a dir with a Packages file will not contain other complete ppkgdirs + return array(substr($dir, strlen($conf['pkgdir_root'])+1)); + } else { + $return=array(); + foreach (glob ($dir.'/*', GLOB_ONLYDIR) as $subdir) { + $return=array_merge($return, get_pkgdirs($subdir)); + } + return $return; + } +} +?> |