diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-05 23:34:22 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-05 23:34:22 +0000 |
commit | 64092c34bdb44b132ff4e87b1f6715d220540fe0 (patch) | |
tree | 157fe490ed0ed6b936b9e659bba3be46998365d8 | |
parent | 78dde2d738ac7b6eeffd79195269d431869178d9 (diff) | |
download | pfsense-64092c34bdb44b132ff4e87b1f6715d220540fe0.zip pfsense-64092c34bdb44b132ff4e87b1f6715d220540fe0.tar.gz |
unbreak the package manager by adding back fetch_latest_pkg_config()
-rw-r--r-- | etc/inc/pfsense-utils.inc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index db2fae0..193bca3 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -915,4 +915,26 @@ function check_firmware_version($tocheck = "all", $return_php = true) { return $raw_versions; } +/* + * fetch_latest_pkg_config: download the latest pkg_config.xml to /tmp/ directory + */ +function fetch_latest_pkg_config() { + global $g; + global $config; + if(!file_exists("{$g['tmp_path']}/pkg_config.xml")) { + $pkg_config_location = $g['pkg_config_location']; + $pkg_config_base_url = $g['pkg_config_base_url']; + if(isset($config['system']['alt_pkgconfig_url']['enabled'])) { + $pkg_config_location = $config['system']['alt_pkgconfig_url']['pkgconfig_base_url'] . $config['system']['alt_pkgconfig_url']['pkgconfig_filename']; + $pkg_config_base_url = $config['system']['alt_pkgconfig_url']['pkgconfig_base_url']; + } + mwexec("/usr/bin/fetch -o {$g['tmp_path']}/pkg_config.xml {$pkg_config_location}"); + if(!file_exists("{$g['tmp_path']}/pkg_config.xml")) { + print_info_box_np("Could not download pkg_config.xml from " . $pkg_config_base_url . ". Check your DNS settings."); + die; + } + } + return; +} + ?> |