Gentoo Archives: gentoo-user

From: Francisco Ares <frares@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Confessional: how I generally use emerge.
Date: Sat, 19 Mar 2016 14:59:26
Message-Id: CAHH9eM4mZOOJo19RHgka+YeA0sFkb4DH2g1skE5owZEivoabpg@mail.gmail.com
In Reply to: Re: [gentoo-user] Confessional: how I generally use emerge. by Dale
1 2016-03-18 14:41 GMT-03:00 Dale <rdalek1967@×××××.com>:
2
3 > Neil Bothwick wrote:
4 > >
5 > >
6 > > Why ask the same question again when you got an answer last time?
7 > >
8 > > Hint: look at the output for asciidoc.
9 > > --
10 > > Sent from my Android phone with K-9 Mail. Please excuse my brevity.
11 >
12 > I have to add this. From what I understand about the scripts he is
13 > using, he is blindly letting emerge do updates without checking to see
14 > if the updates fall into line with what he *needs*. If I read it
15 > correctly, any USE flag change will be missed until it hits the fan and
16 > is broken. That would then mean taking a lot of time to go back through
17 > logs and figuring out just when it went wrong and most importantly, what
18 > caused it and how to fix it. Since the change could have happened
19 > several updates ago, that could involve some work and a lot of rebuilding.
20 >
21 > Doing the sync in a script and even getting a email or something with
22 > the -p output is fine but updating blindly is not a good idea.
23 >
24 > At this point, I think I understand why he is having so much trouble.
25 > At the very least, check to see what USE flags are changing before doing
26 > updates. There are other things that are important but that is one that
27 > changes a good bit.
28 >
29 > Dale
30 >
31 > :-) :-)
32 >
33 >
34 >
35
36 My $0.02. Three scripts, at different cron entries:
37
38
39 $ cat update
40 #! /bin/bash
41 if ! [ -e /root/.working ]
42 then
43 touch /root/.working
44 LOG=/tmp/update.log
45 LOG_TEMP=`/bin/tempfile`
46 date > $LOG
47 umount /usr/portage/distfiles 2> /dev/null
48 mount /usr/portage/distfiles/
49 /usr/sbin/emaint sync -a 1>> $LOG 2>> $LOG && \
50 /usr/bin/layman -S 1>> $LOG 2>> $LOG && \
51 /usr/bin/emerge -fvuDN --with-bdeps=y --complete-graph=y --backtrac=100
52 world 1>> $LOG 2>> $LOG && \
53 /usr/bin/emerge -pvuDN --with-bdeps=y --complete-graph=y --backtrac=100
54 world 1>> $LOG_TEMP 2>> $LOG_TEMP && \
55 cat $LOG_TEMP >> $LOG
56 date >> $LOG
57 echo -e \\n >> $LOG
58 rm -f /root/.working
59 cat $LOG_TEMP | mail -b -c -s "update system" email_address@××××××.com
60 rm -f $LOG_TEMP
61 fi
62
63
64
65
66
67 $ cat emerg
68 #! /bin/bash
69 LOG=/tmp/update.log
70 GREP_PATTERN="[<>=\*][<>=\*][<>=\*] [eEuUcCM(rN]"
71 if ! [ -e /root/.working ]
72 then
73 date > $LOG
74 touch /root/.working
75 echo ---- ---- >> $LOG
76 nice -n 10 emerge -vuDN --with-bdeps=y --complete-graph=y
77 --backtrac=100 --keep-going --quiet-build world 1>> $LOG 2>> $LOG
78 echo ---- ---- >> $LOG
79 nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
80 $LOG 2>> $LOG
81 echo ---- ---- >> $LOG
82 nice -n 10 emerge -vuDN --with-bdeps=y --complete-graph=y
83 --backtrac=100 --keep-going --quiet-build world 1>> $LOG 2>> $LOG
84 echo ---- ---- >> $LOG
85 nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
86 $LOG 2>> $LOG
87 echo ---- ---- >> $LOG
88 nice -n 10 /root/bin/xorg_rebuild 1>> $LOG 2>> $LOG
89 echo ---- ---- >> $LOG
90 nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
91 $LOG 2>> $LOG
92 echo ---- ---- >> $LOG
93
94 nice -n 10 /root/bin/xorg_rebuild 1>> $LOG 2>> $LOG
95 echo ---- ---- >> $LOG
96 nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
97 $LOG 2>> $LOG
98 echo ---- ---- >> $LOG
99 nice -n 10 /usr/sbin/rkhunter --propupd 1>> $LOG 2>> $LOG
100 date >> $LOG
101 echo -n ^D >> $LOG ; cat $LOG | mail -b -c -s "emerge
102 altdimtzlgt002" francisco.ares.altec@×××××.com
103 rm -f /root/.working
104 fi
105
106 if ! [ -e /root/.workhours ]
107 then
108 shutdown -h +1
109 fi
110
111
112 $ cat bin/xorg_rebuild
113 #! /bin/bash
114 if ! [ -e /root/.working ]
115 then
116 touch /root/.working
117
118 XORG_SERVER=`equery l xorg-server`
119 if [ "$XORG_SERVER" != "`cat /root/xorg-server.txt`" ]
120 then
121 EMERGE_LIST=`equery l --format='$name' xf86*`" "`equery l
122 --format='$name' "xorg*"`" "`equery l --format='$name' nvidia-drivers`
123 # EMERGE_LIST=`equery l --format='$name' xf86*`" "`equery l
124 --format='$name' "xorg*"`
125 emerge -vD --with-bdeps=y --keep-going --quiet-build
126 $EMERGE_LIST && \
127 echo $XORG_SERVER>/root/xorg-server.txt && \
128 echo $NVIDIA_DRVR>/root/nvidia-drvr.txt && \
129 rmmod nvidia 2>/dev/null && modprobe nvidia
130 fi
131
132 DRIVER="nvidia-drivers"
133 MOD="nvidia"
134 VIDEO_DRIVR=`equery l $DRIVER`
135 if [ "$VIDEO_DRIVR" != "`cat /root/video-drv.txt`" ]
136 then
137 EMERGE_LIST=`equery l --format='$name' xf86*`" "`equery l
138 --format='$name' "xorg*"`" "`equery l --format='$name' $DRIVER`
139 emerge -vD --with-bdeps=y --keep-going --quiet-build
140 $EMERGE_LIST && \
141 echo $XORG_SERVER>/root/xorg-server.txt && \
142 echo $VIDEO_DRIVR>/root/video-drv.txt && \
143 rmmod $MOD 2>/dev/null && modprobe $MOD
144 fi
145 rm -f /root/.working
146 fi
147
148
149
150
151 Cron entries:
152
153 $ crontab -l
154 # DO NOT EDIT THIS FILE - edit the master and reinstall.
155 # (/tmp/crontab.XXXX0z8ldq installed on Tue Jan 12 09:48:35 2016)
156 # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp
157 $)
158 00 07 * * 1-5 touch /root/.workhours
159 30 07 * * 1-5 touch /root/.workhours
160 00 08 * * 1-5 touch /root/.workhours
161 30 08 * * 1-5 touch /root/.workhours
162 00 09 * * 1-5 touch /root/.workhours
163 30 09 * * 1-5 touch /root/.workhours
164 05 09 * * 1-5 /root/bin/update
165 30 13 * * 1-5 touch /root/.workhours
166 30 12 * * 1-5 /root/bin/emerg
167 00 20 * * 1-5 rm -f /root/.workhours