From 30a9921d8100e1b2dbfc8b3a821cc4f04c0accdb Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Wed, 15 May 2013 20:22:10 +0000 Subject: Work around rpmdb error by insisting rpm+urpmi are installed first. (g)urpmi will install priority upgrades first then restart itself. If the priority upgrades happen to be installed in more than one transaction code in the rpm packages %post script to clear out the rpmdb index files could be run after the first transaction and then the second transaction could regenerate these indexes using the current libdb version in memory. This results in the rpmdb not being readable and requires manual intervension. If the initial priority upgrades are handled in a single transaction this does not occur and the rpmdb indexes are regenerated with the correct libdb. This is a workaround to ensure that the first (g)urpmi run is completed in a single transaction but it shoud only update enough to ensure urpmi and rpm are upgraded. The normal --auto-select cycle can continue thereafter. Ideally this would actually be fixed in urpmi to ensure that any priority updates are handled within a single transaction. --- mgaapplet-upgrade-helper | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mgaapplet-upgrade-helper b/mgaapplet-upgrade-helper index 30a68a2e..b2d9b309 100755 --- a/mgaapplet-upgrade-helper +++ b/mgaapplet-upgrade-helper @@ -99,9 +99,15 @@ sub run_gurpmi() { my $succeeded_win = create_upgrade_succeeded_window(); my $failed_win = create_upgrade_failed_window(); + # Handle the priority upgrades first + # We need to ensure the initial upgrade of rpm+urpmi is done in one + # transaction (hense --split-length=0) as otherwise the rpmdb indexes can be + # rebuilt with the wrong libdb version + fork_gurpmi('--split-length=0', 'rpm', 'urpmi'); + while ($refork_gurpmi) { - my $ok = fork_gurpmi(); + my $ok = fork_gurpmi('--auto-select'); if ($refork_gurpmi && !$ok) { $refork_gurpmi--; } else { @@ -324,9 +330,10 @@ packages as well?).")) sub fork_gurpmi { run_program::raw({ timeout => 'never' }, - 'gurpmi', '>>', $log_file, '2>>', $log_file, '--auto', '--auto-select', '--replacefiles', '--clean', + 'gurpmi', '>>', $log_file, '2>>', $log_file, '--auto', '--replacefiles', '--clean', if_($root, "--urpmi-root=$root"), - if_($download_dir, "--download-all=$download_dir")); + if_($download_dir, "--download-all=$download_dir"), + @_); } sub update_media() { -- cgit v1.2.1