summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authormarcelloc <marcellocoutinho@gmail.com>2013-05-22 13:15:31 -0300
committerMarcello Coutinho <marcellocoutinho@gmail.com>2013-05-22 13:15:31 -0300
commit9b4df982f3e28ceeb8a7a0face1852976d95d9c7 (patch)
tree2e506f7910b9d8b969dc7edbc1d40913f39e9727 /etc/inc
parentda6aebbb431441f36461b786d09c6b6d21d7d4b7 (diff)
downloadpfsense-9b4df982f3e28ceeb8a7a0face1852976d95d9c7.zip
pfsense-9b4df982f3e28ceeb8a7a0face1852976d95d9c7.tar.gz
Add dynamic category tabs for better listing all available packages
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/pkg-utils.inc33
1 files changed, 33 insertions, 0 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index a7e8cc0..644eba9 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -1333,4 +1333,37 @@ function stop_packages() {
}
}
+function package_skip_tests($index,$requested_version){
+ global $config, $g;
+
+ /* Get pfsense version*/
+ $version = rtrim(file_get_contents("/etc/version"));
+
+ if($g['platform'] == "nanobsd")
+ if($index['noembedded'])
+ return true;
+
+ /* If we are on not on HEAD, and the package wants it, skip */
+ if ($version <> "HEAD" && $index['required_version'] == "HEAD" && $requested_version <> "other")
+ return true;
+
+ /* If there is no required version, and the requested package version is not 'none', then skip */
+ if (empty($index['required_version']) && $requested_version <> "none")
+ return true;
+
+ /* If the requested version is not 'other', and the required version is newer than what we have, skip. */
+ if($requested_version <> "other" && (pfs_version_compare("", $version, $index['required_version']) < 0))
+ return true;
+
+ /* If the requestion version is 'other' and we are on the version requested, skip. */
+ if($requested_version == "other" && (pfs_version_compare("", $version, $index['required_version']) == 0))
+ return true;
+
+ /* Package is only for an older version, lets skip */
+ if($index['maximum_version'] && (pfs_version_compare("", $version, $index['maximum_version']) > 0))
+ return true;
+
+ /* Do not skip package list */
+ return false;
+}
?> \ No newline at end of file
OpenPOWER on IntegriCloud