Project

General

Profile

« Previous | Next » 

Revision dff8f2bd

Added by Renato Botelho almost 8 years ago

Detect old workarounds in config upgrade and deal with them

View differences:

src/etc/inc/upgrade_config.inc
5075 5075

  
5076 5076
	/* Copy of upgrade_166_to_167 from 2.4 */
5077 5077
	if (!isset($already_run['upgrade_166_to_167'])) {
5078
		/*
5079
		 * If this box was updated during the small period of time
5080
		 * $config latest_version was set to 15.9, reset it to 15.8
5081
		 * so we are sure this upgrade will not be skipped when move
5082
		 * to 2.4
5083
		 */
5084

  
5085
		if ($config['version'] == "15.9") {
5086
			$config['version'] = "15.8";
5087
		}
5088

  
5078 5089
		if (strpos($config['widgets']['sequence'],
5079 5090
		    'netgate_services_and_support') === false) {
5080 5091
			$widgets = explode(",", $config['widgets']['sequence']);
......
5114 5125

  
5115 5126
	/* Copy of upgrade_168_to_169() from 2.4 */
5116 5127
	if (!isset($already_run['upgrade_168_to_169'])) {
5128
		$found = false;
5129

  
5130
		/* Detect old temporary workaround */
5131
		if (isset($config['cron']['rc_update_pkg_metadata'])) {
5132
			unset($config['cron']['rc_update_pkg_metadata']);
5133
			$found = true;
5134
		}
5135

  
5117 5136
		$command = '/usr/bin/nice -n20 /etc/rc.update_pkg_metadata';
5118 5137

  
5119
		$found = false;
5120
		if (is_array($config['cron']['item'])) {
5138
		if (!$found && is_array($config['cron']['item'])) {
5121 5139
			foreach ($config['cron']['item'] as $entry) {
5122 5140
				if ($entry['command'] == $command) {
5123 5141
					$found = true;

Also available in: Unified diff