View previous topic :: View next topic |
Author |
Message |
Brane2 n00b
Joined: 03 Jul 2011 Posts: 44
|
Posted: Sun Aug 21, 2016 7:50 am Post subject: emerge --resume package list save/restore ? |
|
|
Is there some simple way to save the list of packages that "emerge --resume" would install and to load that list back later ? _________________ On the journey of life I chose the psycho path... |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31019 Location: here
|
Posted: Sun Aug 21, 2016 4:08 pm Post subject: |
|
|
One possible solution
Code: | $ emerge -p --resume | awk 'match($0, /\[.*\]\s(.*)\sUSE.*/, group) {print "="group[1]}' > list_package_resume.txt
# cat list_package_resume.txt | xargs emerge --oneshot -p |
_________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
sammy1 n00b
Joined: 20 Aug 2016 Posts: 1
|
Posted: Mon Aug 22, 2016 1:18 am Post subject: |
|
|
fedeliallalinea wrote: | One possible solution
Code: | $ emerge -p --resume | awk 'match($0, /\[.*\]\s(.*)\sUSE.*/, group) {print "="group[1]}' > list_package_resume.txt
# cat list_package_resume.txt | xargs emerge --oneshot -p |
|
Brilliant, that does the job pretty good. |
|
Back to top |
|
|
[n00b@localhost] Apprentice
Joined: 30 Aug 2004 Posts: 266 Location: London, UK
|
Posted: Mon Aug 22, 2016 10:16 am Post subject: |
|
|
Portage is written in Python. You can access the list with the following couple of lines:
Code: |
import portage
print('\n'.join([ item[2] for item in portage.mtimedb['resume']['mergelist'] ]))
|
|
|
Back to top |
|
|
Brane2 n00b
Joined: 03 Jul 2011 Posts: 44
|
Posted: Tue Aug 23, 2016 12:26 pm Post subject: |
|
|
fedeliallalinea wrote: | One possible solution
Code: | $ emerge -p --resume | awk 'match($0, /\[.*\]\s(.*)\sUSE.*/, group) {print "="group[1]}' > list_package_resume.txt
# cat list_package_resume.txt | xargs emerge --oneshot -p |
|
I did this in the past, but:
- you get the list, but not sequence. IOW, actual original merge could ( and probably would) merge files in different sequence, which could affect the outcome. e.g. it's not the same if package X gets to be emerged before or after library Y that it depends upon.
- it's strictly serial and as such dog slow. Packages get emerged one after another, with no overlap. Original emerge would try to do them in parallel as much as possible.
You can aggregate all packages into one argument, but that tends to choke emerge, if the list is very long. _________________ On the journey of life I chose the psycho path... |
|
Back to top |
|
|
Massimo B. Veteran
Joined: 09 Feb 2005 Posts: 1776 Location: PB, Germany
|
Posted: Wed Mar 27, 2024 9:34 am Post subject: |
|
|
For those having lost the resume list for any reason, I did...
Code: | # eix '-I*' --format '<installedversions:DATESORT>' | sort -nr | cut -f2-3 > resumelist | ...and manually removed the most recent lines sorted by date and the date column for getting a list of the packages not re-build by the last emerge --emptytree.
Then run... Code: | # emerge --oneshot -atv $(< resumelist) |
_________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
|
|