summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-06-28 14:53:26 -0400
committerjim-p <jimp@pfsense.org>2013-06-28 14:53:26 -0400
commitb275b6589670d64270088d0933f02fcc2695945f (patch)
tree305bc5811cb64463e465786f935d2611415906d3 /etc/inc
parentf09f3d6fb9034662cabe1c7e68843b118eb63bf9 (diff)
downloadpfsense-b275b6589670d64270088d0933f02fcc2695945f.zip
pfsense-b275b6589670d64270088d0933f02fcc2695945f.tar.gz
Be a lot more verbose in the logs during package reinstallation.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/pkg-utils.inc23
1 files changed, 19 insertions, 4 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index a7e8cc0..431d675 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -1264,26 +1264,41 @@ function pkg_reinstall_all() {
@unlink('/conf/needs_package_sync');
if (is_array($config['installedpackages']['package'])) {
- echo "One moment please, reinstalling packages...\n";
- echo " >>> Trying to fetch package info...";
+ echo gettext("One moment please, reinstalling packages...\n");
+ echo gettext(" >>> Trying to fetch package info...");
+ log_error(gettext("Attempting to reinstall all packages"));
$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";
+ $error = 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']);
+ echo "\n{$error}\n";
+ log_error(gettext("Cannot reinstall packages: ") . $error);
return;
}
$todo = array();
- foreach($config['installedpackages']['package'] as $package)
+ $all_names = array();
+ foreach($config['installedpackages']['package'] as $package) {
$todo[] = array('name' => $package['name'], 'version' => $package['version']);
+ $all_names[] = $package['name'];
+ }
+ $package_name_list = gettext("List of packages to reinstall: ") . implode(", ", $all_names);
+ echo " >>> {$package_name_list}\n";
+ log_error($package_name_list);
+
foreach($todo as $pkgtodo) {
$static_output = "";
if($pkgtodo['name']) {
+ log_error(gettext("Uninstalling package") . " {$pkgtodo['name']}");
uninstall_package($pkgtodo['name']);
+ log_error(gettext("Finished uninstalling package") . " {$pkgtodo['name']}");
+ log_error(gettext("Reinstalling package") . " {$pkgtodo['name']}");
install_package($pkgtodo['name']);
+ log_error(gettext("Finished installing package") . " {$pkgtodo['name']}");
}
}
+ log_error(gettext("Finished reinstalling all packages."));
} else
echo "No packages are installed.";
}
OpenPOWER on IntegriCloud