summaryrefslogtreecommitdiffstats
path: root/etc/inc/pkg-utils.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-01-12 16:39:17 -0500
committerjim-p <jimp@pfsense.org>2011-01-12 16:39:17 -0500
commitad0d6389a2fd619a4188b98c1058dbb16191e3ce (patch)
tree66e408e16440efe5c954ea38b9981dad41c76665 /etc/inc/pkg-utils.inc
parent7201ca277ed66540baea26ff26ea339ceb15ac9b (diff)
downloadpfsense-ad0d6389a2fd619a4188b98c1058dbb16191e3ce.zip
pfsense-ad0d6389a2fd619a4188b98c1058dbb16191e3ce.tar.gz
Bail on reinstalling all packages if we can't contact the package repo.
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r--etc/inc/pkg-utils.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 411ff7d..2563e44 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -1132,6 +1132,15 @@ function pkg_reinstall_all() {
foreach($config['installedpackages']['package'] as $package)
$todo[] = array('name' => $package['name'], 'version' => $package['version']);
echo "One moment please, reinstalling packages...\n";
+ echo " >>> Trying to fetch package info...";
+ $pkg_info = get_pkg_info();
+ if ($pkg_info) {
+ echo " Done.\n";
+ } else {
+ $xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl'];
+ echo "\n" . sprintf(gettext(' >>> Unable to communicate with %1$s. Please verify DNS and interface configuration, and that %2$s has functional Internet connectivity.'), $xmlrpc_base_url, $g['product_name']) . "\n";
+ return;
+ }
if(is_array($todo)) {
foreach($todo as $pkgtodo) {
$static_output = "";
OpenPOWER on IntegriCloud