Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

emerge --resume package list save/restore ?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
Brane2
n00b
n00b
Posts: 44
Joined: Sun Jul 03, 2011 11:11 pm

emerge --resume package list save/restore ?

  • Quote

Post by Brane2 » Sun Aug 21, 2016 7:50 am

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...
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Sun Aug 21, 2016 4:08 pm

One possible solution

Code: Select all

$ 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.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
sammy1
n00b
n00b
Posts: 1
Joined: Sat Aug 20, 2016 12:13 am

  • Quote

Post by sammy1 » Mon Aug 22, 2016 1:18 am

fedeliallalinea wrote:One possible solution

Code: Select all

$ 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.
Top
[n00b@localhost]
Apprentice
Apprentice
User avatar
Posts: 266
Joined: Mon Aug 30, 2004 1:31 pm
Location: London, UK

  • Quote

Post by [n00b@localhost] » Mon Aug 22, 2016 10:16 am

Portage is written in Python. You can access the list with the following couple of lines:

Code: Select all

import portage
print('\n'.join([ item[2] for item in portage.mtimedb['resume']['mergelist'] ]))
Top
Brane2
n00b
n00b
Posts: 44
Joined: Sun Jul 03, 2011 11:11 pm

  • Quote

Post by Brane2 » Tue Aug 23, 2016 12:26 pm

fedeliallalinea wrote:One possible solution

Code: Select all

$ 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...
Top
Massimo B.
Veteran
Veteran
User avatar
Posts: 1940
Joined: Wed Feb 09, 2005 3:05 pm
Location: PB, Germany

  • Quote

Post by Massimo B. » Wed Mar 27, 2024 9:34 am

For those having lost the resume list for any reason, I did...

Code: Select all

# 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: Select all

# emerge --oneshot -atv $(< resumelist)
HP ZBook Power G9 i7-12700H,64GB DDR5|HP ProDesk 600 G5 i7-9700,128GB DDR4
Top
Post Reply

6 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic