[PC-BSD Commits] r6944 - in websites/pbidir.com/bibivu: bin etc/lang/pt lib

svn at pcbsd.org svn at pcbsd.org
Sun Jun 13 09:39:40 PDT 2010


Author: fabry
Date: 2010-06-13 09:39:39 -0700 (Sun, 13 Jun 2010)
New Revision: 6944

Modified:
   websites/pbidir.com/bibivu/bin/bibivu_cron.php
   websites/pbidir.com/bibivu/etc/lang/pt/pbi.lang.php
   websites/pbidir.com/bibivu/lib/pbi_release.php
Log:
A few fixes on the way the PBI_WATCHER works. it now shows also possible errors with the status of the PBIs

Modified: websites/pbidir.com/bibivu/bin/bibivu_cron.php
===================================================================
--- websites/pbidir.com/bibivu/bin/bibivu_cron.php	2010-06-13 09:03:26 UTC (rev 6943)
+++ websites/pbidir.com/bibivu/bin/bibivu_cron.php	2010-06-13 16:39:39 UTC (rev 6944)
@@ -34,33 +34,57 @@
 					break;
 				case 'pbis_watcher':
 //					$list = explode("\n",`/usr/local/bin/rsync --list-only -vaz isc.pcbsd.org::ftp | grep " PBI/" | sed -e "s,.* PBI/,PBI/,g" `);
-					$list = explode("\n",`/usr/local/bin/rsync --list-only -vaz isc.pcbsd.org::ftp | sed -e "s,.* ,,g" `);
-					$pbi_releases = load_library('pbi_release')->get_all();
-					$list_problems = array();
+					$list						= explode("\n",`/usr/local/bin/rsync --list-only -vaz isc.pcbsd.org::ftp | sed -e "s,.* ,,g" `);
+					$pbi_releases				= load_library('pbi_release')->get_all();
+					$list_problems				= array();
+					$list_problems_no_status	= array();
 					foreach($pbi_releases as $key=>$pbi_release){
 						if($this->is_web()){
 							echo $pbi_release['id'].' => '.$pbi_release['mirror_path'].' - ';
 						}
-						$pbi_release['mirror_path'] = substr($pbi_release['mirror_path'],0,1)=='/'?substr($pbi_release['mirror_path'],1):$pbi_release['mirror_path'];
-						if(!in_array($pbi_release['mirror_path'],$list)){
-							$list_problems[] = $pbi_release;
+						if($pbi_release['pbi_active']!='y' || $pbi_release['active']!='y'){
 							if($this->is_web()){
-								echo 'not found<br />';
+								echo 'NOT ACTIVE<br />';
 							}
-						} else {
+						} elseif($pbi_release['current_status_id']==0 || $pbi_release['pbi_status_id']==0){
+							$list_problems_no_status[] = $pbi_release;
 							if($this->is_web()){
-								echo 'ok<br />';
+								echo 'NO STATUS<br />';
 							}
+						} else {
+							$pbi_release['mirror_path'] = substr($pbi_release['mirror_path'],0,1)=='/'?substr($pbi_release['mirror_path'],1):$pbi_release['mirror_path'];
+							if(!in_array($pbi_release['mirror_path'],$list)){
+								$list_problems[] = $pbi_release;
+								if($this->is_web()){
+									echo 'not found<br />';
+								}
+							} else {
+								if($this->is_web()){
+									echo 'ok<br />';
+								}
+							}
 						}
 					}
+					$body = '';
 					if(count($list_problems)>0){
 						//there are soe problems...
 						//going to send the problems via email
 						//only to root users
-						$body = 'the PBI watcher script found that those PBIs are in pbidir.com, but not in the main mirror (isc.pcbsd.org::ftp)'."\n\n";
+						$body .= 'the PBI watcher script found that those PBIs are in pbidir.com, but not in the main mirror (isc.pcbsd.org::ftp)'."\n\n";
 						foreach($list_problems as $key=>$pbi_release){
 							$body .= $pbi_release['id'].' => '.$pbi_release['mirror_path']."\n";
 						}
+					}
+					if(count($list_problems_no_status)>0){
+						//there are soe problems...
+						//going to send the problems via email
+						//only to root users
+						$body .= 'the PBI watcher script found that those PBIs (or one of their release) do not have a valid status, you may wat to inactivate them'."\n\n";
+						foreach($list_problems_no_status as $key=>$pbi_release){
+							$body .= $pbi_release['pbi_id'].' => '.$pbi_release['pbi']."\n";
+						}
+					}
+					if($body!=''){
 						if($this->is_web()){
 							$body .= "\n".'Manually execute from the web';
 						}

Modified: websites/pbidir.com/bibivu/etc/lang/pt/pbi.lang.php
===================================================================
--- websites/pbidir.com/bibivu/etc/lang/pt/pbi.lang.php	2010-06-13 09:03:26 UTC (rev 6943)
+++ websites/pbidir.com/bibivu/etc/lang/pt/pbi.lang.php	2010-06-13 16:39:39 UTC (rev 6944)
@@ -1,44 +1,44 @@
-<?php
-//pbi strings
-$lang['description'] = 'Descrição';
-$lang['vendor'] = 'Vendedor';
-$lang['avg_rate'] = 'Classificação média';
-$lang['your_rate'] = 'A sua classificação';
-$lang['downloads'] = 'Downloads';
-$lang['licence'] = 'Licença';
-$lang['maintainer'] = 'Manutenção';
-
-$lang['version'] = 'Versão';
-$lang['summary'] = 'Sumário';
-$lang['size'] = 'Tamanho';
-$lang['added'] = 'Adicionado';
-
-$lang['login_to_vote'] = 'Please <a href="%s">Login</a> To be able to Vote';
-$lang['cannot_vote'] = 'Sorry, You cannot Vote at this time!';
-
-$lang['login_to_comment'] = 'Por favor, faça <a href="%s">Login</a> parapoder Adicionar Comentários a este pbi';
-$lang['cannot_comment'] = 'Desculpe, não pode colocar comentários neste momento!';
-$lang['leave_comment'] = 'Clique aqui para Adicionar um comentário pbi';
-$lang['save_comment'] = 'Guardar comentário';
-
-$lang['subscribe'] = 'Subscreva para receber actualizações';
-$lang['unsubscribe'] = 'Cancele a subrição de actualizações';
-
-$lang['succesfully_subscribed'] = 'Subscrito com sucesso';
-$lang['succesfully_unsubscribed'] = 'Cancelamento de subscrição com sucesso';
-
-$lang['alternative'] = 'Alternativo para';
-
-$lang['alternative_for_windows_package'] = 'Alternativa para pacote windwos';
-$lang['use_wine']  = 'Utiliza Wine';
-$lang['interface'] = 'Interface';
-$lang['graphical'] = 'Gráfico';
-$lang['web'] = 'Web';
-$lang['command_line'] = 'Linha de comendos';
-$lang['graphical_interface'] = 'Interface gráfica';
-$lang['web_interface'] = 'Interface  WEB';
-$lang['command_line_interface'] = 'Linha de comandos';
-
-$lang['offsite_download'] = 'Clique aqui para efectuar o download",	//followed by PBI name
-
+<?php
+//pbi strings
+$lang['description'] = 'Descrição';
+$lang['vendor'] = 'Vendedor';
+$lang['avg_rate'] = 'Classificação média';
+$lang['your_rate'] = 'A sua classificação';
+$lang['downloads'] = 'Downloads';
+$lang['licence'] = 'Licença';
+$lang['maintainer'] = 'Manutenção';
+
+$lang['version'] = 'Versão';
+$lang['summary'] = 'Sumário';
+$lang['size'] = 'Tamanho';
+$lang['added'] = 'Adicionado';
+
+$lang['login_to_vote'] = 'Please <a href="%s">Login</a> To be able to Vote';
+$lang['cannot_vote'] = 'Sorry, You cannot Vote at this time!';
+
+$lang['login_to_comment'] = 'Por favor, faça <a href="%s">Login</a> parapoder Adicionar Comentários a este pbi';
+$lang['cannot_comment'] = 'Desculpe, não pode colocar comentários neste momento!';
+$lang['leave_comment'] = 'Clique aqui para Adicionar um comentário pbi';
+$lang['save_comment'] = 'Guardar comentário';
+
+$lang['subscribe'] = 'Subscreva para receber actualizações';
+$lang['unsubscribe'] = 'Cancele a subrição de actualizações';
+
+$lang['succesfully_subscribed'] = 'Subscrito com sucesso';
+$lang['succesfully_unsubscribed'] = 'Cancelamento de subscrição com sucesso';
+
+$lang['alternative'] = 'Alternativo para';
+
+$lang['alternative_for_windows_package'] = 'Alternativa para pacote windwos';
+$lang['use_wine']  = 'Utiliza Wine';
+$lang['interface'] = 'Interface';
+$lang['graphical'] = 'Gráfico';
+$lang['web'] = 'Web';
+$lang['command_line'] = 'Linha de comendos';
+$lang['graphical_interface'] = 'Interface gráfica';
+$lang['web_interface'] = 'Interface  WEB';
+$lang['command_line_interface'] = 'Linha de comandos';
+
+$lang['offsite_download'] = 'Clique aqui para efectuar o download';	//followed by PBI name
+
 ?>
\ No newline at end of file

Modified: websites/pbidir.com/bibivu/lib/pbi_release.php
===================================================================
--- websites/pbidir.com/bibivu/lib/pbi_release.php	2010-06-13 09:03:26 UTC (rev 6943)
+++ websites/pbidir.com/bibivu/lib/pbi_release.php	2010-06-13 16:39:39 UTC (rev 6944)
@@ -244,7 +244,10 @@
 		$return = parent::get_info();
 		if(!isset($return['status']) && isset($return['current_status_id'])){		//do this only once
 			$return['pbi']					= $this->get_record($return['pbi_id'],'pbi')->get('name');
+			$return['pbi_status_id']		= $this->get_record($return['pbi_id'],'pbi')->get('current_status_id');
 			$return['status']				= $this->get_record($return['current_status_id'],'status')->get('name');
+			$return['pbi_status']			= $this->get_record($return['pbi_status_id'],'status')->get('name');
+			$return['pbi_active']			= $this->get_record($return['pbi_id'],'pbi')->get('active');
 			$tmp							= $this->get_record($return['pcbsd_version_id'],'pcbsd_version');
 			$return['pcbsd_version']		= $tmp->get('version').' '.$tmp->get('name');
 			$this->current = $return;



More information about the Commits mailing list