summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2013-05-30 00:46:45 -0700
committerErmal Luçi <eri@pfsense.org>2013-05-30 00:46:45 -0700
commit3740c81012b128041234f809e35881843e6066e5 (patch)
treeea2f12e3670d8718b9ff34414764dc784c59eab5 /etc/inc
parent0a860dda6c7107be65cf7a04807c7e0c23d82ac7 (diff)
parent9b4df982f3e28ceeb8a7a0face1852976d95d9c7 (diff)
downloadpfsense-3740c81012b128041234f809e35881843e6066e5.zip
pfsense-3740c81012b128041234f809e35881843e6066e5.tar.gz
Merge pull request #646 from marcelloc/master
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