From 6ad7ed52fd1e004d69040d634724cb5a2a9a7ba3 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 25 Mar 2008 10:54:19 +0000 Subject: [PATCH] Updated FAI packages. -Partly implemented GOsa-si FAI packages support git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9966 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiPackage.inc | 76 +++++++++++-------- .../fai/class_faiPackageConfiguration.inc | 26 ++++--- 2 files changed, 59 insertions(+), 43 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index dba5a7a20..79cd57a0b 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -421,39 +421,53 @@ class faiPackage extends plugin function genPkgs() { - /* Generate a list off available packages for this mirror, section and release - */ - /* Only read this file if it wasn't read before */ - if($this->buffer === NULL){ - $this->buffer=array(); - $a_ret = array(); - foreach($this->FAIdebianSection as $sec){ - $strID= CONFIG_DIR."/fai/".$this->FAIdebianRelease."/".$sec; - - if(!is_file($strID)){ - msg_dialog::display(_("Error"), sprintf(_("Package file '%s' does not exist!"), $strID), ERROR_DIALOG); - unset($this->buffer); - return(array()); - } - $fp = fopen($strID,"r"); - - /* Parse every line and create an array */ - while(!feof($fp)){ - $str= fgets($fp,512); - $stra= split("\|",$str); - if(count($stra)==4){ - $a_ret[$stra[0]] = $stra; - } - } - fclose($fp); - /* Save our Data, to avoid reading it again */ + if($this->buffer === NULL || !count($this->buffer)){ + $this->buffer = array(); + $q = new gosaSupportDaemon(); + $ret = $q->FAI_get_packages($this->FAIdebianRelease); + foreach($ret as $attr){ + $this->buffer[$attr['PACKAGE']] = array($attr['PACKAGE'],$attr['VERSION'],$attr['SECTION'],$attr['DESCRIPTION']); } - $this->buffer = $a_ret; - ksort($a_ret); - return($a_ret); - }else{ - return $this->buffer; } + return $this->buffer; + +# /* Generate a list off available packages for this mirror, section and release +# */ +# /* Only read this file if it wasn't read before */ +# $this->buffer = NULL; +# if($this->buffer === NULL){ +# $this->buffer=array(); +# $a_ret = array(); +# foreach($this->FAIdebianSection as $sec){ +# $strID= CONFIG_DIR."/fai/".$this->FAIdebianRelease."/".$sec; +# +# if(!is_file($strID)){ +# msg_dialog::display(_("Error"), sprintf(_("Package file '%s' does not exist!"), $strID), ERROR_DIALOG); +# unset($this->buffer); +# return(array()); +# } +# $fp = fopen($strID,"r"); +# +# /* Parse every line and create an array */ +# while(!feof($fp)){ +# $str= fgets($fp,512); +# $stra= split("\|",$str); +# if(count($stra)==4){ +# $a_ret[$stra[0]] = $stra; +# break; +# } +# } +# fclose($fp); +# /* Save our Data, to avoid reading it again */ +# } +# $this->buffer = $a_ret; +# ksort($a_ret); +# print_a($this->buffer); +# return($a_ret); +# }else{ +# print_a($this->buffer); +# return $this->buffer; +# } } diff --git a/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc b/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc index 0a371a8e8..f132c3b04 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc @@ -15,18 +15,18 @@ class faiPackageConfiguration extends plugin { plugin::plugin ($config, $dn); $this->obj = $obj; - $this->Debconf_handle = new debconf(); - $this->Debconf_handle->set_template_directory($path); - $this->Debconf_handle->set_package($this->obj); - $this->Debconf_handle->set_language(preg_replace('/_.*$/', '', get_browser_language())); - - if( $this->Debconf_handle->load() ) { - $this->pkg_config = $pkg_config; - - foreach($this->pkg_config as $var){ - $this->Debconf_handle->SetDefault($var['Name'],$var['Value']); - } - } +# $this->Debconf_handle = new debconf(); +# $this->Debconf_handle->set_template_directory($path); +# $this->Debconf_handle->set_package($this->obj); +# $this->Debconf_handle->set_language(preg_replace('/_.*$/', '', get_browser_language())); +# +# if( $this->Debconf_handle->load() ) { +# $this->pkg_config = $pkg_config; +# +# foreach($this->pkg_config as $var){ +# $this->Debconf_handle->SetDefault($var['Name'],$var['Value']); +# } +# } } function execute() @@ -34,6 +34,8 @@ class faiPackageConfiguration extends plugin /* Call parent execute */ plugin::execute(); + return("Not implemented yet"); + /* Fill templating stuff */ $smarty = get_smarty(); $display = ""; -- 2.30.2