View previous topic :: View next topic |
Author |
Message |
ASID Apprentice
Joined: 22 Mar 2006 Posts: 195
|
Posted: Wed Dec 06, 2006 12:10 pm Post subject: |
|
|
Great script count_zero!
Keep up the good work! |
|
Back to top |
|
|
count_zero Guru
Joined: 17 May 2004 Posts: 460 Location: Little Rock, Arkansas, USA
|
Posted: Wed Dec 06, 2006 4:56 pm Post subject: |
|
|
Thanks to ryker for submitting the update-world script to the GWN for this week's Tips & Tricks section.
http://www.gentoo.org/news/en/gwn/20061204-newsletter.xml
I appreciate all of the support and helpful feedback from everyone!
count_zero _________________ "We must all hang together, or assuredly we shall all hang separately."
-Ben Franklin |
|
Back to top |
|
|
Phlogiston Veteran
Joined: 27 Jan 2004 Posts: 1925 Location: Europe, Swizerland
|
Posted: Wed Dec 06, 2006 10:19 pm Post subject: |
|
|
It will be nice if the script keeps the colored output of emerge.
Thanks anyway... _________________ Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor |
|
Back to top |
|
|
Phlogiston Veteran
Joined: 27 Jan 2004 Posts: 1925 Location: Europe, Swizerland
|
Posted: Wed Dec 06, 2006 10:23 pm Post subject: |
|
|
Furthermore could you please add an option for choosing -N (--newuse) or not, because I don't like to update my UseFlags on every world update. _________________ Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor |
|
Back to top |
|
|
ryker Guru
Joined: 28 May 2003 Posts: 412 Location: Portage, IN
|
Posted: Wed Dec 06, 2006 10:28 pm Post subject: |
|
|
Adding --newuse should only recompile packages with use flags that have changed. If none have changed, nothing extra is compiled. If they some use flags have changed, you really should recompile the package anyway.
Of course, I don't see any harm in offering the option to not use --newuse, but why would you intentionally not recompile a package with the proper use flags?
If it's because you just add use flags to your /etc/make.conf without regard for it's impact on other packages, that's a totally different issue. _________________ Athlon 64 3200+, 80G WD sata hd + 200G IDE, 1G Geil DDR400, MSI K8T Neo
IntelCore2Duo 2.0Ghz MSI laptop,100G SATA hd, 2G RAM |
|
Back to top |
|
|
Mine GO BOOM n00b
Joined: 15 Feb 2004 Posts: 7
|
Posted: Wed Dec 06, 2006 11:12 pm Post subject: |
|
|
Phlogiston wrote: | It will be nice if the script keeps the colored output of emerge. |
Along these lines, I generally like to look at the -v USE flags, so whenever compiling I know if some use flag is off when it should be on. Sometimes when projects upgrade, they'll add a new use flag or another and it is nice to see it in the -vDu list. |
|
Back to top |
|
|
colourblindangus n00b
Joined: 30 Oct 2004 Posts: 4 Location: Oxford, England
|
Posted: Wed Dec 06, 2006 11:20 pm Post subject: |
|
|
Great script, thanks!
Just a small thing:
When you run the script with no arguments and you get the about page, the version number is still 1.0
I only mention it as it is useful for keeping track of which version I have installed (and I am a bit of a perfectionist). |
|
Back to top |
|
|
bunkacid Tux's lil' helper
Joined: 11 Jan 2005 Posts: 111 Location: Laguna Hills, CA
|
Posted: Thu Dec 07, 2006 2:05 am Post subject: sweet! |
|
|
Thanks for the script. This is something that is definitely needed for those long compile times we all love to hate.
I like the above suggestions about keeping color output, when preparing the list of packages.
I took the liberty to make a diff patch file for update-world which includes the correct version in the usage output.
The patch also uses sudo for the main emerge operation which requires root privileges. Obviously this will require you to enter your password at least once depending on your sudo configuration.
http://px.ns1.net:81/~px/files/update-world.patch
I would also suggest that this script be added to the gentoolkit package as it is another great tool like elog. |
|
Back to top |
|
|
count_zero Guru
Joined: 17 May 2004 Posts: 460 Location: Little Rock, Arkansas, USA
|
Posted: Thu Dec 07, 2006 5:35 am Post subject: |
|
|
I just updated the script to preserve colored output from the emerge command. I also fixed the version numbering (sorry colourblindangus!) in the help output.
@bunkacid:
I don't usually use sudo while using this script (just su -), but can't you just
Code: | sudo update-world --install |
to get it to work with sudo? I don't think the script needs to be modified to do this properly. _________________ "We must all hang together, or assuredly we shall all hang separately."
-Ben Franklin |
|
Back to top |
|
|
bunkacid Tux's lil' helper
Joined: 11 Jan 2005 Posts: 111 Location: Laguna Hills, CA
|
Posted: Thu Dec 07, 2006 5:57 am Post subject: |
|
|
count_zero wrote: |
@bunkacid:
I don't usually use sudo while using this script (just su -), but can't you just
Code: | sudo update-world --install |
to get it to work with sudo? I don't think the script needs to be modified to do this properly. |
@count_zero
Ideally you should only be using root privileges which are needed for the actual emerge install.
Most of the stuff your script is doing from what I can tell is creating lists, which in my eyes should be done by the user, if he/she has the correct privileges to do so.
There's an old sysadmin adage about using a lightsaber to open a can of soup, when all you need is a pocket knife, but I forget how it goes. |
|
Back to top |
|
|
capira Tux's lil' helper
Joined: 02 May 2005 Posts: 147 Location: Spain
|
Posted: Thu Dec 07, 2006 8:03 am Post subject: |
|
|
Hi all!
After reading this thread it's come to mi mind a very useful thread in the Spanish subforum (here).
Although the script is completely write in spanish, the code is easy to read . Mainly, what this script do is:
- Sync your system
- Download all the sources
- Create a package for every ebuild
- Send you an email, noticing which packages are ready an which need a manual emerging
I have improved it in several, making it more clever (the last post by capira)
If you find it useful, I would not mind to translated it in English. _________________ http://www.nosoftwarepatents.com/ |
|
Back to top |
|
|
tschenturs n00b
Joined: 17 Nov 2004 Posts: 12
|
Posted: Thu Dec 07, 2006 8:26 am Post subject: |
|
|
Thanks for the script, capira.
I have found an issue with my make.conf. It still contains comments with the word PORT_LOGDIR in it. Hence the grep is not successful. I'd suggest the following change:
Code: |
--- update-world.orig 2006-12-07 09:17:39.000000000 +0100
+++ update-world 2006-12-07 09:18:08.000000000 +0100
@@ -28,7 +28,7 @@
emergelist=$homedir/emergelist
emergetemp=$workdir/emergetemp
failedlist=$homedir/failedlist
-portlogdir=`cat /etc/make.conf | grep PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
+portlogdir=`cat /etc/make.conf | grep "^PORT_LOGDIR" | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'`
masked=$homedir/masked
# parameter for '--empty' to emerge -e world
if [[ $1 == '--empty' || $1 == '-e' ]]
|
HTH, Urs |
|
Back to top |
|
|
capira Tux's lil' helper
Joined: 02 May 2005 Posts: 147 Location: Spain
|
Posted: Thu Dec 07, 2006 9:45 am Post subject: |
|
|
I think that the variables should be check before doing anything.
A good way is: Code: |
...
source /etc/make.conf
...
if [ ${PORT_LOGDIR}NORL = 'NORL' ]
then
echo "ERROR: PORT_LOGDIR should be set in your /etc/make.conf"
exit 1
fi
|
_________________ http://www.nosoftwarepatents.com/ |
|
Back to top |
|
|
Phlogiston Veteran
Joined: 27 Jan 2004 Posts: 1925 Location: Europe, Swizerland
|
Posted: Thu Dec 07, 2006 11:54 am Post subject: |
|
|
count_zero wrote: | I just updated the script to preserve colored output from the emerge command. I also fixed the version numbering (sorry colourblindangus!) in the help output. |
Thanks thats great to hear! _________________ Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor |
|
Back to top |
|
|
drjimmy42 Guru
Joined: 03 Feb 2003 Posts: 512 Location: Nashua, NH
|
Posted: Thu Dec 07, 2006 12:57 pm Post subject: |
|
|
Fantastic script. Truly very useful. One more suggestion.
To make this a nice complete package for keeping your system up to date and healthy it might be good to have a revdep-rebuild call at the end. So that if everything works out well you have updated all your packages, with new use flags taken into account (very good addition btw) and all dynamic linking is happy.
It almost takes all the fun out of running Gentoo;-) |
|
Back to top |
|
|
tejing n00b
Joined: 12 Jul 2005 Posts: 4
|
Posted: Thu Dec 07, 2006 2:46 pm Post subject: |
|
|
this should definitely be put in gentoolkit once it's been tested and worked on for a while. great work.
Tejing |
|
Back to top |
|
|
trupoet Apprentice
Joined: 08 Aug 2002 Posts: 160
|
Posted: Thu Dec 07, 2006 4:24 pm Post subject: |
|
|
tejing wrote: | this should definitely be put in gentoolkit once it's been tested and worked on for a while. great work.
Tejing |
I second that notion. Was just going to post that myself |
|
Back to top |
|
|
ArNiS n00b
Joined: 06 Dec 2005 Posts: 63 Location: Saint-Petersburg, Russia
|
Posted: Thu Dec 07, 2006 4:44 pm Post subject: |
|
|
Many thanks, count_zero! It's excellent and very usefull stuff. _________________ Today is the first day of the remained life |
|
Back to top |
|
|
mci_nano n00b
Joined: 28 Nov 2004 Posts: 32 Location: BS; Germany
|
Posted: Thu Dec 07, 2006 6:09 pm Post subject: |
|
|
hey, i'm trying to get this thing running
but failed on first try. cause sed seems not to work as supposed to. check that for you too...
Code: | [ebuild U ] sys-libs/timezone-data-2006p [2006o] USE="nls" 336 kB |
sed'ed into emergelist gives
this seems to happen because of my utf8 settings (i figured that out with a guy from #sed on freenode, thx to redduck676)...
so if we replace the regexp we could get it better also for utf8 people... see that diff... maybe you could think about it
Code: |
83c83
< cat $emergelist | sed '/^[TC]/d' | sed 's/\[ebuild.*[ A-Z]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' > $emergetemp
---
> cat $emergelist | sed '/^[TC]/d' | sed 's/\[ebuild.*[ [:upper:]]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' > $emergetemp
|
that gives the supposed
Code: | =sys-libs/timezone-data-2006p |
finaly i'll go to update my system _________________ AMD Athlon 64 3700+; Nvidia 7800GT; 1GB RAM |
|
Back to top |
|
|
RCGodward n00b
Joined: 08 Dec 2006 Posts: 3
|
Posted: Fri Dec 08, 2006 12:50 am Post subject: |
|
|
Thank you so much. Lately I've found myself updating my systems once a week so that it doesn't take too much time and I can watch it the whole time. Can't wait to try it out on a major update. |
|
Back to top |
|
|
baldo n00b
Joined: 08 Dec 2006 Posts: 10 Location: Krefeld, Germany
|
Posted: Fri Dec 08, 2006 3:12 am Post subject: |
|
|
hi guys,
found another bug.
when emerge says it will update portage the following output will break emergelist
Code: | *** Portage will stop merging at this point and reload itself,
then resume the merge. |
it will result in
i would consider to replace
Code: | cat $emergelist | sed '/^[TC]/d' | sed 's/\[ebuild.*[ A-Z]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' | > $emergetemp |
(line 83) with
Code: | cat $emergelist | grep "^\[" | sed '/^[TC]/d' | sed 's/\[ebuild.*[ A-Z]\]\ //' | sed '/^[ ]/d' | sed '/^[ ]*$/d' | sed '/Portage\ overlays/d' | sed 's/\ .*$//' | sort -d | sed 's/.*/\=&/' | > $emergetemp |
works fine for me so far. nice script.
by the way: i also noticed the bug above. will try this fix |
|
Back to top |
|
|
count_zero Guru
Joined: 17 May 2004 Posts: 460 Location: Little Rock, Arkansas, USA
|
Posted: Fri Dec 08, 2006 4:48 am Post subject: |
|
|
Quote: | found another bug.
when emerge says it will update portage the following output will break emergelist |
Thanks!
I've actually already fixed this with a much more elegant sed command than the one in the original version, which will be included in the next release (along with a pretty useful improvement, but you'll just have to wait and see ) _________________ "We must all hang together, or assuredly we shall all hang separately."
-Ben Franklin |
|
Back to top |
|
|
drjimmy42 Guru
Joined: 03 Feb 2003 Posts: 512 Location: Nashua, NH
|
Posted: Fri Dec 08, 2006 3:23 pm Post subject: |
|
|
I found that if you have the line
Code: | portlogdir=`cat /etc/make.conf | grep PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'` |
will catch a comment with PORT_LOGDIR in it which is what is in make.conf.example. Since I used that as a template the variable portlogdir was getting the value of the line with the comment at the beginning.
To fix this I change the command above to specify the beginning of the line to be sure you are grabbing the variable name.
Code: | portlogdir=`cat /etc/make.conf | grep ^PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'` |
Fantastic script. Truly awesome. Thanks. |
|
Back to top |
|
|
count_zero Guru
Joined: 17 May 2004 Posts: 460 Location: Little Rock, Arkansas, USA
|
Posted: Fri Dec 08, 2006 7:48 pm Post subject: |
|
|
drjimmy42 wrote: | I found that if you have the line
Code: | portlogdir=`cat /etc/make.conf | grep PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'` |
will catch a comment with PORT_LOGDIR in it which is what is in make.conf.example. Since I used that as a template the variable portlogdir was getting the value of the line with the comment at the beginning.
To fix this I change the command above to specify the beginning of the line to be sure you are grabbing the variable name.
Code: | portlogdir=`cat /etc/make.conf | grep ^PORT_LOGDIR | sed 's/PORT_LOGDIR=//' | sed 's/\"//g' | sed 's/\/$//'` |
Fantastic script. Truly awesome. Thanks. |
Fixed in next release! _________________ "We must all hang together, or assuredly we shall all hang separately."
-Ben Franklin |
|
Back to top |
|
|
drjimmy42 Guru
Joined: 03 Feb 2003 Posts: 512 Location: Nashua, NH
|
Posted: Fri Dec 08, 2006 10:03 pm Post subject: |
|
|
Thanks. Did you think any about integrating revdep-rebuild into the script? I haven't really looked into how, it would just be cool to have only one script to run to keep things humming along. |
|
Back to top |
|
|
|