Commit 59a3107a authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1164 Add config option to disable executing fixstates on upgrade.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 54cb4db0
......@@ -5,7 +5,7 @@
case "$1" in
configure)
/usr/sbin/z-push-admin -a fixstates
/usr/sbin/z-push-admin -a fixstates-upgrade
if [ $? -ne 0 ]; then
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
......
......@@ -259,12 +259,25 @@ class ZPushAdminCLI {
self::$command = self::COMMAND_CLEARLOOP;
break;
// clear loop detection data
// fix states
case "fixstates":
case "fix":
self::$command = self::COMMAND_FIXSTATES;
break;
// hidden feature to run fixstates after upgrading the packages - this is called from postinst only
case "fixstates-upgrade":
// don't execute fixstates during upgrade if IGNORE_FIXSTATES_ON_UPGRADE is set to true
if (!defined('IGNORE_FIXSTATES_ON_UPGRADE') || IGNORE_FIXSTATES_ON_UPGRADE == false) {
self::$command = self::COMMAND_FIXSTATES;
}
else {
// print warning and exit gracefully
echo "\nZ-Push: Not executing 'fixstates' as IGNORE_FIXSTATES_ON_UPGRADE is set. You should execute 'z-push-admin -a fixstates' manually!\n\n";
exit(0);
}
break;
default:
self::UsageInstructions();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment