From 6fe6318a4e9e8d92776edffd0b1ba6618857a6ee Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@cd1c1023-2f26-0410-ae45-c471fc1f0318> Date: Wed, 12 Mar 2008 17:22:28 +0000 Subject: [PATCH] - fix possible issues with linux->grub device name conversion - try to fix a weird issue with writelines() in trigger_remove_boot_grub() git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1458 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropy.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libraries/entropy.py b/libraries/entropy.py index 0b8977e98..51017fe34 100644 --- a/libraries/entropy.py +++ b/libraries/entropy.py @@ -6559,7 +6559,8 @@ timeout=10 new_conf.append(line) f = open(etpConst['systemroot']+"/boot/grub/grub.conf","w") - f.writelines(new_conf) + for line in new_conf: + f.write(line) f.flush() f.close() @@ -6611,8 +6612,15 @@ timeout=10 # get disk match = re.subn("[0-9]","",gboot) gdisk = match[0] + if gdisk == '': + self.Entropy.updateProgress( + bold(" QA Warning: ") + brown("cannot match %s device with a GRUB one!! Cannot properly configure kernel! Defaulting to (hd0,0)") % (gboot,), + importance = 0, + header = red(" ##") + ) + return "(hd0,0)" match = re.subn("[a-z/]","",gboot) - gpartnum = str(int(match[0])-1) + gpartnum = str(int(gdisk)-1) # now match with grub device_map = etpConst['packagestmpdir']+"/grub.map" if os.path.isfile(device_map):