Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Hassle-free emerge -uD world (update-world v1.8)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
ASID
Apprentice
Apprentice


Joined: 22 Mar 2006
Posts: 193

PostPosted: Wed Dec 06, 2006 12:10 pm    Post subject: Reply with quote

Great script count_zero!
Keep up the good work!
Back to top
View user's profile Send private message
count_zero
Guru
Guru


Joined: 17 May 2004
Posts: 459
Location: Little Rock, Arkansas, USA

PostPosted: Wed Dec 06, 2006 4:56 pm    Post subject: Reply with quote

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! :D

count_zero
_________________
"We must all hang together, or assuredly we shall all hang separately."
-Ben Franklin
Back to top
View user's profile Send private message
Phlogiston
Veteran
Veteran


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Wed Dec 06, 2006 10:19 pm    Post subject: Reply with quote

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


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Wed Dec 06, 2006 10:23 pm    Post subject: Reply with quote

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. 8)
_________________
Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor
Back to top
View user's profile Send private message
ryker
Guru
Guru


Joined: 28 May 2003
Posts: 412
Location: Portage, IN

PostPosted: Wed Dec 06, 2006 10:28 pm    Post subject: Reply with quote

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


Joined: 15 Feb 2004
Posts: 7

PostPosted: Wed Dec 06, 2006 11:12 pm    Post subject: Reply with quote

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


Joined: 30 Oct 2004
Posts: 4
Location: Oxford, England

PostPosted: Wed Dec 06, 2006 11:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
bunkacid
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jan 2005
Posts: 111
Location: Laguna Hills, CA

PostPosted: Thu Dec 07, 2006 2:05 am    Post subject: sweet! Reply with quote

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


Joined: 17 May 2004
Posts: 459
Location: Little Rock, Arkansas, USA

PostPosted: Thu Dec 07, 2006 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
bunkacid
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jan 2005
Posts: 111
Location: Laguna Hills, CA

PostPosted: Thu Dec 07, 2006 5:57 am    Post subject: Reply with quote

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
View user's profile Send private message
capira
Tux's lil' helper
Tux's lil' helper


Joined: 02 May 2005
Posts: 147
Location: Spain

PostPosted: Thu Dec 07, 2006 8:03 am    Post subject: Reply with quote

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


Joined: 17 Nov 2004
Posts: 12

PostPosted: Thu Dec 07, 2006 8:26 am    Post subject: Reply with quote

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
View user's profile Send private message
capira
Tux's lil' helper
Tux's lil' helper


Joined: 02 May 2005
Posts: 147
Location: Spain

PostPosted: Thu Dec 07, 2006 9:45 am    Post subject: Reply with quote

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


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Thu Dec 07, 2006 11:54 am    Post subject: Reply with quote

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


Joined: 03 Feb 2003
Posts: 512
Location: Nashua, NH

PostPosted: Thu Dec 07, 2006 12:57 pm    Post subject: Reply with quote

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


Joined: 12 Jul 2005
Posts: 4

PostPosted: Thu Dec 07, 2006 2:46 pm    Post subject: Reply with quote

this should definitely be put in gentoolkit once it's been tested and worked on for a while. great work.

Tejing
Back to top
View user's profile Send private message
trupoet
Apprentice
Apprentice


Joined: 08 Aug 2002
Posts: 160

PostPosted: Thu Dec 07, 2006 4:24 pm    Post subject: Reply with quote

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


Joined: 06 Dec 2005
Posts: 63
Location: Saint-Petersburg, Russia

PostPosted: Thu Dec 07, 2006 4:44 pm    Post subject: Reply with quote

Many thanks, count_zero! It's excellent and very usefull stuff.
_________________
Today is the first day of the remained life
Back to top
View user's profile Send private message
mci_nano
n00b
n00b


Joined: 28 Nov 2004
Posts: 32
Location: BS; Germany

PostPosted: Thu Dec 07, 2006 6:09 pm    Post subject: Reply with quote

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
Code:
=USE="nls"


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


Joined: 08 Dec 2006
Posts: 3

PostPosted: Fri Dec 08, 2006 12:50 am    Post subject: Reply with quote

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


Joined: 08 Dec 2006
Posts: 10
Location: Krefeld, Germany

PostPosted: Fri Dec 08, 2006 3:12 am    Post subject: Reply with quote

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
Code:
=***


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


Joined: 17 May 2004
Posts: 459
Location: Little Rock, Arkansas, USA

PostPosted: Fri Dec 08, 2006 4:48 am    Post subject: Reply with quote

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 :wink:)
_________________
"We must all hang together, or assuredly we shall all hang separately."
-Ben Franklin
Back to top
View user's profile Send private message
drjimmy42
Guru
Guru


Joined: 03 Feb 2003
Posts: 512
Location: Nashua, NH

PostPosted: Fri Dec 08, 2006 3:23 pm    Post subject: Reply with quote

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


Joined: 17 May 2004
Posts: 459
Location: Little Rock, Arkansas, USA

PostPosted: Fri Dec 08, 2006 7:48 pm    Post subject: Reply with quote

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


Joined: 03 Feb 2003
Posts: 512
Location: Nashua, NH

PostPosted: Fri Dec 08, 2006 10:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
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