Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge --resume package list save/restore ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Brane2
n00b
n00b


Joined: 03 Jul 2011
Posts: 44

PostPosted: Sun Aug 21, 2016 7:50 am    Post subject: emerge --resume package list save/restore ? Reply with quote

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
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30918
Location: here

PostPosted: Sun Aug 21, 2016 4:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
sammy1
n00b
n00b


Joined: 20 Aug 2016
Posts: 1

PostPosted: Mon Aug 22, 2016 1:18 am    Post subject: Reply with quote

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
View user's profile Send private message
[n00b@localhost]
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 266
Location: London, UK

PostPosted: Mon Aug 22, 2016 10:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Brane2
n00b
n00b


Joined: 03 Jul 2011
Posts: 44

PostPosted: Tue Aug 23, 2016 12:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1771
Location: PB, Germany

PostPosted: Wed Mar 27, 2024 9:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum