diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php index 7ad1d85ca8..9a526aa5f6 100755 --- a/usr/local/www/pkg_mgr.php +++ b/usr/local/www/pkg_mgr.php @@ -43,22 +43,20 @@ if($pkg_info) { $fout = fopen("{$g['tmp_path']}/pkg_info.cache", "w"); fwrite($fout, serialize($pkg_info)); fclose($fout); - //$pkg_sizes = get_pkg_sizes(); + //$pkg_sizes = get_pkg_sizes(); } else { $using_cache = true; if(file_exists("{$g['tmp_path']}/pkg_info.cache")) { - $savemsg = "Unable to retrieve package info from {$g['xmlrpcbaseurl']}. Cached data will be used."; + $savemsg = "Unable to retrieve package info from {$g['xmlrpcbaseurl']}. Cached data will be used."; $pkg_info = unserialize(@file_get_contents("{$g['tmp_path']}/pkg_info.cache")); } else { $savemsg = "Unable to communicate to {$g['product_website']}. Please check DNS, default gateway, etc."; } } -if (! empty($_GET)) { - if (isset($_GET['ver'])) { - $requested_version = htmlspecialchars($_GET['ver']); - } -} +if (! empty($_GET)) + if (isset($_GET['ver'])) + $requested_version = htmlspecialchars($_GET['ver']); $pgtitle = array("System","Package Manager"); include("head.inc"); @@ -67,134 +65,134 @@ include("head.inc"); - - - - - - +
- "" ? false : true, "pkg_mgr.php"); - $tab_array[] = array("Packages for any platform", $requested_version == "none" ? true : false, "pkg_mgr.php?ver=none"); -/* $tab_array[] = array("Packages with a different version", $requested_version == "other" ? true : false, "pkg_mgr.php?ver=other"); */ - $tab_array[] = array("Installed Packages", false, "pkg_mgr_installed.php"); - display_top_tabs($tab_array); -?> -
-
- - - - - - - - - - +
Package NameCategoryStatusMaintainerDescription
+ + "; - } else { - $pkgs = array(); - $instpkgs = array(); - if($config['installedpackages']['package'] != "") - foreach($config['installedpackages']['package'] as $instpkg) $instpkgs[] = $instpkg['name']; - $pkg_names = array_keys($pkg_info); - $pkg_keys = array(); - foreach($pkg_names as $name) { - if(!in_array($name, $instpkgs)) $pkg_keys[] = $name; - } - sort($pkg_keys); - if(count($pkg_keys) != 0) { - foreach($pkg_keys as $key) { - $index = &$pkg_info[$key]; - if(in_array($index['name'], $instpkgs)) continue; - $dot = strpos($index['required_version'], "."); - $index['major_version'] = substr($index['required_version'], 0, $dot); + $version = file_get_contents("/etc/version"); + $dot = strpos($version, "."); + $hyphen = strpos($version, "-"); + $major = substr($version, 0, $dot); + $minor = substr($version, $dot + 1, $hyphen - $dot - 1); + $testing_version = substr($version, $hyphen + 1, strlen($version) - $hyphen); - if ($version <> "HEAD" && - $index['required_version'] == "HEAD" && - $requested_version <> "other") { continue; } - if (empty($index['required_version']) && - $requested_version <> "none") { continue; } - if($index['major_version'] > $major && - $requested_version <> "other") { continue; } - if(isset($index['major_version']) && - $requested_version == "none") { continue; } - if($index['major_version'] == $major && - $requested_version == "other") { continue; } - - ?> - - - - - - - + + + - +
There are currently no packages available for installation.
- - - - - -
- -
- platform: -
+ $tab_array = array(); + $tab_array[] = array("Available {$version} packages", $requested_version <> "" ? false : true, "pkg_mgr.php"); + $tab_array[] = array("Packages for any platform", $requested_version == "none" ? true : false, "pkg_mgr.php?ver=none"); +// $tab_array[] = array("Packages with a different version", $requested_version == "other" ? true : false, "pkg_mgr.php?ver=other"); + $tab_array[] = array("Installed Packages", false, "pkg_mgr_installed.php"); + display_top_tabs($tab_array); + ?> +
+
+ + + + + + + + + {$index['maintainer']}"; + if(!$pkg_info) { + echo ""; } else { - echo "Nobody. Apply for it!"; + $pkgs = array(); + $instpkgs = array(); + if($config['installedpackages']['package'] != "") + foreach($config['installedpackages']['package'] as $instpkg) $instpkgs[] = $instpkg['name']; + $pkg_names = array_keys($pkg_info); + $pkg_keys = array(); + foreach($pkg_names as $name) + if(!in_array($name, $instpkgs)) $pkg_keys[] = $name; + sort($pkg_keys); + if(count($pkg_keys) != 0) { + foreach($pkg_keys as $key) { + $index = &$pkg_info[$key]; + if(in_array($index['name'], $instpkgs)) continue; + $dot = strpos($index['required_version'], "."); + $index['major_version'] = substr($index['required_version'], 0, $dot); + + if ($version <> "HEAD" && + $index['required_version'] == "HEAD" && + $requested_version <> "other") + continue; + if (empty($index['required_version']) && + $requested_version <> "none") + continue; + if($index['major_version'] > $major && + $requested_version <> "other") + continue; + if(isset($index['major_version']) && + $requested_version == "none") + continue; + if($index['major_version'] == $major && + $requested_version == "other") + continue; + ?> + + + + + + + + + + + '; + } } ?> - - - - - '; - } - } - ?> -
Package NameCategoryStatusMaintainerDescription
There are currently no packages available for installation.
+ + + + + +
+ +
+ platform: +
+ {$index['maintainer']}"; + else + echo "Nobody. Apply for it!"; + ?> + + + + +
There are currently no packages available for installation.
- - - -
There are currently no packages available for installation.
-
-
+
+