$value) { $pkg=$pkg_tab[$section_id]["pkg"]; foreach( $pkg as $pkg_id => $value) { if( $pkg_id == $pkg_id_lookup) { return $section_id; } } } return ""; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_get_name( $pkg_id_lookup) { global $pkg_tab; foreach( $pkg_tab as $section_id => $value) { $pkg=$pkg_tab[$section_id]["pkg"]; foreach( $pkg as $pkg_id => $value) { if( $pkg_id == $pkg_id_lookup) { return $pkg[$pkg_id]["name"]; } } } return ""; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_curverrel_get( $id) { $cmd="ls -rt download/$id/*/$id*.src.rpm | sed -e 's/^download.$id.//' -e 's/.src.rpm$//'"; $curverrel=exec($cmd); $tab=explode( "/", $curverrel); $curver=$tab[0]; $tab=explode( "-$curver-", $curverrel); $currel=$tab[1]; return( array( $curver, $currel)); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_list_get( $id, $curver, $currel) { $cmd="ls download/$id/$curver/$id-*$curver-$currel* | sort | sed -e 's/^download.$id.$curver.//'"; exec($cmd, $list); return( $list); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_tag_get( $pkg_id, $pkg_curver, $pkg_currel, $pkg_name, $pkg_qt) { if( $pkg_name == "") { $pkg_name="$pkg_id-$pkg_curver-$pkg_currel.src.rpm"; } $cmd="rpm -qp --qf \"$pkg_qt\" download/$pkg_id/$pkg_curver/$pkg_name | sed -e 's//\>/g'"; exec( $cmd, $reply_tab); return $reply_tab; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_tab_dump( $tab, $start) { for( $i = $start; $i < count($tab); $i++) { echo "$tab[$i]\n"; } } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_main_header( $name) { $page_name="$name"; $page_title="$page_name !"; global $pkg_tab; global $pkg_header; global $pkg_keywords; $keywords="$pkg_keywords"; foreach( $pkg_tab as $section_id => $value) { foreach( $pkg_tab[$section_id]["pkg"] as $pkg_id => $value) { $keywords="$keywords,$pkg_id"; } } include "$pkg_header"; echo " $page_name

$page_title

Rx3.Org Main Page

"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_main_body( $pkg_tab) { global $pkg_download_http_url; global $pkg_download_ftp_url; global $pkg_notes; echo "



"; foreach( $pkg_tab as $section_id => $value) { $section_name=$pkg_tab[$section_id]["name"]; $pkg=$pkg_tab[$section_id]["pkg"]; echo "

$section_name



"; } echo "



$pkg_notes


"; echo "Rx3 Free Software Packaging HTTP download page   "; echo "Rx3 Free Software Packaging FTP download page   
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_main_page() { global $pkg_tab; pkg_main_header( "Rx3 Free Software Packaging Main Page"); pkg_main_body( $pkg_tab); pkg_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_header( $id, $name, $summary, $curver, $currel) { $page_name="Rx3 $name Home Page"; $page_title="$page_name !"; global $pkg_url; global $pkg_header; global $pkg_keywords; $keywords="$pkg_keywords,$id"; include "$pkg_header"; echo " $page_name

$page_title

$summary

$curver-$currel

Rx3.Org Main Page  /  Rx3 Free Software Packaging Main Page

"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_body( $id, $name, $curver, $currel) { global $pkg_download_http_url; global $pkg_download_ftp_url; $description = pkg_tag_get( $id, $curver, $currel, "", "%{DESCRIPTION}"); $change_log = pkg_tag_get( $id, $curver, $currel, "", "%{CHANGELOGTIME:date} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}"); echo "



";

  pkg_tab_dump( $description, 0);

  echo "    



"; echo "



Last Release Notes:
"; echo "
";

  pkg_tab_dump( $change_log, 0);

  echo "    
"; $pkg_list = pkg_list_get( $id, $curver, $currel); if( $pkg_list != "") { echo"
Sub-Package List:

"; for( $i = 0; $i < count($pkg_list); $i++) { echo "   $pkg_list[$i]"; } echo "

"; } echo"
"; echo "$name changelog page   "; echo "$name file list page   "; echo "$name HTTP download page   "; echo "$name FTP download page   "; echo "
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_footer() { global $pkg_myname; global $pkg_myver; global $pkg_footer; global $time_start; include "$pkg_footer"; $time_stop = microtime_float(); $time_elaps = intval( ( $time_stop - $time_start) * 1000) / 1000; echo "

"; echo "
Page generated in $time_elaps seconds by $pkg_myname V $pkg_myver
"; echo" "; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_page( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel) { $summary = pkg_tag_get( $pkg_id, $pkg_curver, $pkg_currel, "", "%{SUMMARY}"); $pkg_summary = $summary[0]; pkg_header( $pkg_id, $pkg_name, $pkg_summary, $pkg_curver, $pkg_currel); pkg_body( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel); pkg_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_cl_header( $id, $name, $curver, $currel) { $page_name="Rx3 $name ChangeLog Page"; $page_title="$page_name"; global $pkg_url; global $pkg_header; global $pkg_keywords; $keywords="$pkg_keywords,$id, rx3 $id changelog"; include "$pkg_header"; echo " $page_name

$page_title

$curver-$currel

Rx3.Org Main Page  /  Rx3 Free Software Packaging Main Page  /  Rx3 $name Home Page

"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_cl_body( $id, $curver, $currel) { echo "
";

  $changelog_tab = pkg_tag_get( $id, $curver, $currel, "", "[\n%{CHANGELOGTIME:date}   %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n]");
  pkg_tab_dump( $changelog_tab, 0);

  echo "    
"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_cl_page( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel) { pkg_cl_header( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel); pkg_cl_body( $pkg_id, $pkg_curver, $pkg_currel); pkg_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_fl_header( $id, $name, $curver, $currel) { $page_name="Rx3 $name File List Page"; $page_title="$page_name"; global $pkg_url; global $pkg_header; global $pkg_keywords; $keywords="$pkg_keywords,$id, rx3 $id file list"; include "$pkg_header"; echo " $page_name

$page_title

$curver-$currel

Rx3.Org Main Page  /  Rx3 Free Software Packaging Main Page  /  $name Home Page

"; } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_fl_body( $id, $curver, $currel) { $pkg_list = pkg_list_get( $id, $curver, $currel); if( $pkg_list != "") { for( $i = 0; $i < count($pkg_list); $i++) { echo"
Sub-Package $pkg_list[$i]:
";

      $filelist_tab = pkg_tag_get( $id, $curver, $currel, $pkg_list[$i], "[%{FILENAMES}\n]");
      pkg_tab_dump( $filelist_tab, 0);
  
      echo "    
"; if( $i < count($pkg_list) - 1) { echo"
"; } } } else { echo "
";

      $filelist_tab = pkg_tag_get( $id, $curver, $currel, "", "[%{FILENAMES}\n]");
      pkg_tab_dump( $filelist_tab, 0);

      echo "    
"; } } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ function pkg_fl_page( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel) { pkg_fl_header( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel); pkg_fl_body( $pkg_id, $pkg_curver, $pkg_currel); pkg_footer(); } /*--------------------------------------------------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------------------------------------------------*/ if( $_GET["pkg"] == "") { pkg_main_page( $pkg_tab); } else { $pkg_id=$_GET["pkg"]; $section_id=pkg_get_section( $pkg_id); $pkg_name=$pkg_tab[$section_id]["pkg"][$pkg_id]["name"]; $pkg_curverrel=pkg_curverrel_get( $pkg_id); $pkg_curver=$pkg_curverrel[0]; $pkg_currel=$pkg_curverrel[1]; if( $_GET["cl"] == "yes") { pkg_cl_page( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel); } else { if( $_GET["fl"] == "yes") { pkg_fl_page( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel); } else { pkg_page( $pkg_id, $pkg_name, $pkg_curver, $pkg_currel); } } } ?>