summaryrefslogtreecommitdiffstats
path: root/mgaapplet-upgrade-helper
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-05-15 20:22:10 +0000
committerColin Guthrie <colin@mageia.org>2013-05-15 20:22:10 +0000
commit30a9921d8100e1b2dbfc8b3a821cc4f04c0accdb (patch)
tree4c3fcc0d220855b4b5cb99afd68cfabde10a3457 /mgaapplet-upgrade-helper
parentd5d73978015f032292085b783ed62a9bc10be069 (diff)
downloadmgaonline-30a9921d8100e1b2dbfc8b3a821cc4f04c0accdb.tar
mgaonline-30a9921d8100e1b2dbfc8b3a821cc4f04c0accdb.tar.gz
mgaonline-30a9921d8100e1b2dbfc8b3a821cc4f04c0accdb.tar.bz2
mgaonline-30a9921d8100e1b2dbfc8b3a821cc4f04c0accdb.tar.xz
mgaonline-30a9921d8100e1b2dbfc8b3a821cc4f04c0accdb.zip
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.
Diffstat (limited to 'mgaapplet-upgrade-helper')
-rwxr-xr-xmgaapplet-upgrade-helper13
1 files 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() {