Gentoo Archives: gentoo-user

From: David Haller <gentoo@×××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to resume 'emerge -e @world' after grub fails?
Date: Mon, 18 Dec 2017 20:12:13
Message-Id: 20171218200552.45anprwnkcc6ws3x@grusum.endjinn.de
In Reply to: Re: [gentoo-user] How to resume 'emerge -e @world' after grub fails? by Francisco Ares
1 Hello,
2
3 On Mon, 18 Dec 2017, Francisco Ares wrote:
4 >2017-12-18 17:02 GMT-02:00 David Haller <gentoo@×××××××.de>:
5 >> On Mon, 18 Dec 2017, Mick wrote:
6 [..]
7 >> >Let's not forget the '--keep-going y' option too. At the end it will
8 >> print a
9 >> >list of all the packages that failed to emerge.
10 >>
11 >> Well, there's a catch though. I did:
12 >>
13 >> $ emerge -e --keep-going @world
14 >> [some failed pkg(s)]
15 >> [Ctrl-C due to going to sleep etc.]
16 >> $ emerge -e --keep-going --resume @world
17 >> [Ctrl-C due to going to sleep etc.]
18 >> [some failed pkg(s)]
19 >> $ emerge -e --keep-going --resume @world
20 >> [Ctrl-C due to going to sleep etc.]
21 >> [2 more failed pkg(s)]
22 >> [emerge prints just those two failed pkgs that failed since the last
23 >> resume]
24 >>
25 >> And no "failed pgks" were printed at those Ctrl-C...
26 >>
27 >> Only trace was probably deep in the emerge logs and the leftovers in
28 >> /var/tmp/portage (-> you should not these down before you shut down if
29 >> that's a tmpfs ...)
30 >>
31 >> I think something about this should be done / documented.
32 [..]
33 >I have a script for "-e" :
34 >
35 >#! /bin/bash
36 [..]
37 >nice -n 10 emerge -1v --keep-going --quiet-build =$GCC_VER
38 >sys-devel/libtool 1>> $LOG 2>> $LOG && \
39 >nice -n 10 emerge -1v --keep-going --quiet-build dev-libs/glib
40 >sys-libs/glibc 1>> $LOG 2>> $LOG && \
41
42 I think you've got those reversed. glib depends on glibc. And, besides
43 being a lib that more and more (basic) packages depend on for utility,
44 has nothing to do with (g)libc. It's started as a basic utility lib
45 for the Gimp Toolkit (gtk) ... ;)
46
47 >nice -n 10 emerge -1vb --keep-going --quiet-build =$GCC_VER
48 >sys-devel/libtool 1>> $LOG 2>> $LOG && \
49
50 Is this rebuild of gcc / libtool intentional? And what about binutils?
51 Those are quite critical, IMO.
52
53 >nice -n 10 emerge -vbe --keep-going --quiet-build world 1>> $LOG 2>> $LOG
54 >echo ---- ---- Resuming... >> $LOG
55
56 Ah, yeah. Logging. I should've done that. But, as I said, I noticed
57 too late about that "problem" with resume and failed packages.
58
59 BTW: your script will be much easier to maintain if you rewrite is as
60 such:
61
62 ====
63 exec 1>>$LOG
64 exec 2>>$LOG
65 # more redirs, e.g. for console output possible
66 ====
67
68 and instead of all those
69
70 ====
71 foo && \
72 bar && ...
73 ====
74
75 write
76
77 ====
78 foo || exit 1
79 bar || exit 2
80 ...
81 ====
82
83 or some such. And this stuff:
84
85 >nice -n 10 emerge -vb --resume --keep-going --quiet-build 1>> $LOG 2>> $LOG
86 >echo ---- ---- Resuming... >> $LOG
87 >nice -n 10 emerge -vb --resume --keep-going --quiet-build 1>> $LOG 2>> $LOG
88 >echo ---- ---- Resuming... >> $LOG
89 [..]
90 >echo ---- ---- Finishing. >> $LOG
91
92 could be wrapped in a loop... I don't know, but I'd hope emerge exits
93 with a status != 0 if packages failed. And if so, you could use
94
95 ====
96 while ! nice -n 10 emerge ... ; do
97 echo ---- ---- Resuming...
98 done
99 echo ---- ---- Finishing.
100 ====
101
102 (assuming you've redirected fd1 to $LOG as mentioned above ;)
103
104 [..]
105 >Please note the "-b" flag, as I keep binary packages for an emergency.
106
107 So do I. And I keep a /stage3 dir around. If python/portage breaks,
108 I just need to point PATH & LD_LIBRARY_PATH and stuff to /stage3/bla
109 and can restart. BTDT when pulling 4-years abandoned gentoo up to date
110 last year...
111
112 >Hope this helps,
113
114 Yeah. Logging ;) And,
115
116 HTH, too,
117 -dnh
118
119 --
120 Sheridan: "I'll tell you one thing. If the primates that we came from had
121 known that some day politicians would come out of the gene pool, they'd have
122 stayed up in the trees and written evolution off as a bad idea!"
123 -- Babylon 5, 2x04 - A Distant Star