Revision 84d0ea1c
Added by Renato Botelho about 10 years ago
etc/inc/pkg-utils.inc | ||
---|---|---|
772 | 772 |
} |
773 | 773 |
} |
774 | 774 |
|
775 |
function package_skip_tests($index,$requested_version) { |
|
776 |
global $config, $g; |
|
777 |
|
|
778 |
/* Get pfsense version*/ |
|
779 |
$version = rtrim(file_get_contents("/etc/version")); |
|
780 |
|
|
781 |
if ($g['platform'] == "nanobsd") { |
|
782 |
if ($index['noembedded']) { |
|
783 |
return true; |
|
784 |
} |
|
785 |
} |
|
786 |
|
|
787 |
/* If we are on not on HEAD, and the package wants it, skip */ |
|
788 |
if ($version <> "HEAD" && $index['required_version'] == "HEAD" && $requested_version <> "other") { |
|
789 |
return true; |
|
790 |
} |
|
791 |
|
|
792 |
/* If there is no required version, and the requested package version is not 'none', then skip */ |
|
793 |
if (empty($index['required_version']) && $requested_version <> "none") { |
|
794 |
return true; |
|
795 |
} |
|
796 |
|
|
797 |
/* If the requested version is not 'other', and the required version is newer than what we have, skip. */ |
|
798 |
if ($requested_version <> "other" && (pfs_version_compare("", $version, $index['required_version']) < 0)) { |
|
799 |
return true; |
|
800 |
} |
|
801 |
|
|
802 |
/* If the requested version is 'other' and we are on the version requested, skip. */ |
|
803 |
if ($requested_version == "other" && (pfs_version_compare("", $version, $index['required_version']) == 0)) { |
|
804 |
return true; |
|
805 |
} |
|
806 |
|
|
807 |
/* Package is only for an older version, lets skip */ |
|
808 |
if ($index['maximum_version'] && (pfs_version_compare("", $version, $index['maximum_version']) > 0)) { |
|
809 |
return true; |
|
810 |
} |
|
811 |
|
|
812 |
/* Do not skip package list */ |
|
813 |
return false; |
|
814 |
} |
|
815 |
|
|
816 | 775 |
function verify_all_package_servers() { |
817 | 776 |
return verify_package_server(get_active_xml_rpc_base_url()); |
818 | 777 |
} |
usr/local/www/pkg_mgr.php | ||
---|---|---|
149 | 149 |
$categories=array(); |
150 | 150 |
if(is_array($pkg_keys)) { |
151 | 151 |
foreach($pkg_keys as $key) { |
152 |
if (!package_skip_tests($pkg_info[$key],$requested_version)) |
|
153 |
$categories[$pkg_info[$key]['category']]++; |
|
154 |
} |
|
152 |
$categories[$pkg_info[$key]['category']]++; |
|
155 | 153 |
} |
156 | 154 |
ksort($categories); |
157 | 155 |
$cm_count=0; |
... | ... | |
206 | 204 |
if(get_package_id($index['name']) >= 0 ) |
207 | 205 |
continue; |
208 | 206 |
|
209 |
if (package_skip_tests($index,$requested_version)) |
|
210 |
continue; |
|
211 |
|
|
212 | 207 |
/* get history/changelog git dir */ |
213 | 208 |
$commit_dir=explode("/",$index['config_file']); |
214 | 209 |
$changeloglink = "https://github.com/pfsense/pfsense-packages/commits/master/config/"; |
Also available in: Unified diff
Remove package_skip_tests(), it won't be necessary anymore with pkg