| View previous topic :: View next topic |
| Author |
Message |
drak n00b

Joined: 18 Jun 2003 Posts: 40
|
Posted: Tue Jan 23, 2007 8:48 am Post subject: [SOLVED] Resume contains packages no longer available |
|
|
I was in the process of emerge -eb world during the weekend, after changing gcc compilers and when I tried to continue Monday morning I got the following message, I don't really want to start from the beginning again!
| Code: |
emerge --resume -p
These are the packages that would be merged, in order:
!!! Error: The resume list contains packages that are no longer
!!! available to be emerged. Please restart/continue
!!! the merge operation manually.
|
Does anyone know where this list is so that I can work out what packages I need to continue Alternatively a better way to continue?
Thanks
Last edited by drak on Tue Jan 23, 2007 4:35 pm; edited 1 time in total |
|
| Back to top |
|
 |
drak n00b

Joined: 18 Jun 2003 Posts: 40
|
Posted: Tue Jan 23, 2007 2:26 pm Post subject: |
|
|
load_emerge_config() uses the following to get the list of packages for the resume.
| Code: |
mtimedb = portage.MtimeDB(mtimedbfile)
|
however I have been unable to find this anywhere so far, alternatively if I knew about python I might be able to display the list stored in portage on the console. |
|
| Back to top |
|
 |
MonkeeSage n00b

Joined: 23 Jan 2007 Posts: 10
|
Posted: Tue Jan 23, 2007 3:58 pm Post subject: |
|
|
The data is stored in /var/cache/edb/mtimedb, which is in the python pickle format. Here is a simple script to list and edit the resume list:
| Code: | #!/bin/env python
# Script to edit portage resume list
# Jordan Callicoat < MonkeeSage at gmail dot com >
# public domain
import os, sys, pickle, re
if '-h' in sys.argv or '--help' in sys.argv:
sys.exit('''
Script to edit portage resume list
-l List items in resume list [default]
-d NUM Delete item from list
''')
int_rexp = re.compile(r'\d+')
def packge_list(how='read', what=None):
try:
if how == 'read':
fhand = open('/var/cache/edb/mtimedb', 'rb')
data = pickle.load(fhand)
fhand.close()
return data
else:
fhand = open('/var/cache/edb/mtimedb', 'wb')
pickle.dump(what, fhand)
fhand.close()
return True
except:
sys.exit()
data = packge_list()
if (not data.has_key('resume') or
len(data['resume']['mergelist']) == 0):
sys.exit('Nothing in resume list')
elif '-l' in sys.argv or len(sys.argv) == 1:
counter = 1
print 'Items in resume list:'
for item in data['resume']['mergelist']:
print ' %d.) %s' % (counter, item[2])
counter += 1
elif '-d' in sys.argv:
index = sys.argv.index('-d') + 1
if len(sys.argv) == 2:
sys.exit('Error: -d option requires an argument')
elif not int_rexp.match(sys.argv[index]):
sys.exit('Error: -d option requires a numeric argument')
else:
index = int(sys.argv[index]) - 1
if len(data['resume']['mergelist']) >= index:
del data['resume']['mergelist'][index]
packge_list(how='write', what=data)
|
I also wrote a little script to make a resume "point." It just makes a copy of the file with the resume info so you can load that copy later. So you can emerge something else then resume the original merge later.
| Code: | #!/bin/env python
# Script to create/delete a portage resume point
# Jordan Callicoat < MonkeeSage at gmail dot com >
# public domain
import os, sys, shutil
real_path = '/var/cache/edb/mtimedb'
back_path = '%s.resume' % real_path
if '-h' in sys.argv or '--help' in sys.argv:
sys.exit('''
Script to create/delete a portage resume point
-r, --resume Resumes from last point
-d, --delete Deletes resume point
[default] Creates resume point
''')
elif '-d' in sys.argv or '--delete' in sys.argv:
try:
os.unlink(back_path)
except:
pass
print "Removed `%s'" % back_path
else:
if '-r' in sys.argv or '--resume' in sys.argv:
shutil.copy(back_path, real_path)
os.system('emerge --resume')
else:
shutil.copy(real_path, back_path)
print "Created `%s'" % back_path
|
[Edit: Fixed first script for when there is no resume list present]
Last edited by MonkeeSage on Thu Feb 15, 2007 12:24 am; edited 1 time in total |
|
| Back to top |
|
 |
drak n00b

Joined: 18 Jun 2003 Posts: 40
|
Posted: Tue Jan 23, 2007 4:34 pm Post subject: |
|
|
Thanks this is great!
Shame that I had just given up and looked in emerge.log to see what the last package was and then use emerge -ep world to get a file list before awk'ing and removing all packages up to the last package from the emerge.log |
|
| Back to top |
|
 |
Daeluin n00b


Joined: 04 Jan 2003 Posts: 57 Location: lost
|
Posted: Fri Feb 02, 2007 2:18 pm Post subject: |
|
|
| Thanks, very useful! |
|
| Back to top |
|
 |
MonkeeSage n00b

Joined: 23 Jan 2007 Posts: 10
|
Posted: Thu Feb 15, 2007 12:25 am Post subject: |
|
|
| This first script would die if there was no resume list (e.g., after a successful emerge), so I fixed that. |
|
| Back to top |
|
 |
|