Project

General

Profile

« Previous | Next » 

Revision bed6c19b

Added by Renato Botelho over 9 years ago

Detect binary packages installed but not registered in the system and do it during boot

View differences:

src/etc/inc/pkg-utils.inc
452 452
	return $result;
453 453
}
454 454

  
455
/*
456
 * If binary pkg is installed but post-install tasks were not
457
 * executed yet, fo it now.
458
 * This scenario can happen when a pkg is pre-installed during
459
 * build phase, and at this point, cannot find a running system
460
 * to register itself in config.xml and also execute custom
461
 * install functions
462
 */
463
function register_all_installed_packages() {
464
	global $g, $config, $pkg_interface;
465

  
466
	$pkg_info = get_pkg_info('all', 'all', true);
467

  
468
	foreach ($pkg_info as $pkg) {
469
		if (!isset($pkg['installed'])) {
470
			continue;
471
		}
472

  
473
		pkg_remove_prefix($pkg['name']);
474

  
475
		if (is_package_installed($pkg['name'])) {
476
			continue;
477
		}
478

  
479
		update_status(sprintf(gettext(
480
		    "Running last steps of %s installation.") . "\n",
481
		    $pkg['name']));
482
		install_package_xml($pkg['name']);
483
	}
484
}
485

  
455 486
/*
456 487
 * resync_all_package_configs() Force packages to setup their configuration and rc.d files.
457 488
 * This function may also print output to the terminal indicating progress.

Also available in: Unified diff