Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lemerge : A script to update everthing possible.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
La`res
Arch/Herd Tester
Arch/Herd Tester


Joined: 11 Aug 2003
Posts: 79
Location: ::0

PostPosted: Tue Jul 27, 2004 3:00 pm    Post subject: lemerge : A script to update everthing possible. Reply with quote

A simple script that runs emerge, looks for everything to update, and updates it.
If the package could not be updated, the last SKIPDONE if statement lets you know what couldn't be done.
It was made first as a function for zsh, so syntax may be different for bash || sh || csh ....
I have code as /usr/local/bin/lemerge.sh

Any of the normal emerge flags will be passed on to emerge
    /usr/local/bin/lemerge.sh world --sync
will result in emerge --sync and then emerge world.

Code:
#!/bin/zsh
# Lares' wrapper for gentoo's emerge.
# NOTE: ${/--sync} filters out the --sync flag.

echo "\nRunning lemerge.sh $*\n"

trap 'echo "\nIn trap"' ZERR

source /etc/make.conf

if [[ $USE = (*doc*) ]]; then
        DoDoc=1
        USE=${USE//doc}
fi

if [[ $* = (*--sync*) ]]; then
        DoSync=1
fi

EmergeOPTS=${*/--sync}

if (( ${DoSync} )); then
#       echo "in --sync String";
        emerge --sync;
fi

echo "\nRunning USE='-doc'emerge $EmergeOPTS\n"
echo "$USE"
echo "$EmergeOPTS"
emerge --update --ask  --deep --verbose --newuse $EmergeOPTS
# While $? not equal to success, continue with the rest.
        while (($? != 0 )) do ;
                emerge --resume --skipfirst;
                SkipDone=1
        done

echo "\nRunning revdep-rebuild"
revdep-rebuild

echo "\nRunning etc-update"
exec etc-update

if (( ${DoDoc} )); then
        echo "\n Running USE='doc' emerge $EmergeOPTS\n";
        USE={$USE doc};
        emerge --update --deep --verbose --newuse $EmergeOPTS;
fi

if (( ${SkipDone} )); then
        echo "\n\nThe Following could not be compliled by lemerge"
        exec emerge --update --deep --verbose --pretend --newuse $EmergeOPTS
fi


If you have any suggestions/ Ideas/ Problems. Post away.
Version 1.3 -- made the docs emerge After the main emerge
Version 1.2 -- added revdep-rebuild and made some other minor changes
Version 1.1 -- Removed --upgradeonly and added --ask and added #! line
Version 1.0 -- Initial Post


Last edited by La`res on Thu Aug 25, 2005 7:55 pm; edited 3 times in total
Back to top
View user's profile Send private message
Rainmaker
Veteran
Veteran


Joined: 12 Feb 2004
Posts: 1650
Location: /home/NL/ehv/

PostPosted: Tue Jul 27, 2004 5:07 pm    Post subject: Reply with quote

How's this different from emerge -uD?
_________________
If you can't dazzle them with brilliance, baffle them with bullshit.
Back to top
View user's profile Send private message
regeya
Apprentice
Apprentice


Joined: 28 Jul 2002
Posts: 270
Location: Desoto, IL, USA

PostPosted: Tue Jul 27, 2004 5:10 pm    Post subject: Reply with quote

Rainmaker wrote:
How's this different from emerge -uD?


Reading the script would tell you...it seems to be well-documented... :wink: Sorry, I'm in a bitter, pissy mood today. Please forgive my unforgiving mood.

Since you didn't, it looks like it does a -uD world, then if there's a failure, it does a --resume --skipfirst.
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Wed Jul 28, 2004 3:33 am    Post subject: Reply with quote

You may want to try using --emptytree also, and using --updateonly is very bad....
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
crafteh
n00b
n00b


Joined: 30 Mar 2004
Posts: 29

PostPosted: Wed Jul 28, 2004 5:01 am    Post subject: Reply with quote

what's wrong with using --updateonly ?
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Wed Jul 28, 2004 12:25 pm    Post subject: Reply with quote

this thread, specifically this post
people need to be learning about the /etc/portage/package.* files.
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1734
Location: Kentucky

PostPosted: Tue Aug 10, 2004 2:35 am    Post subject: Reply with quote

kamagurka wrote:
this thread, specifically this post
people need to be learning about the /etc/portage/package.* files.


So what do we put in /etc/portage/package that tells portage to never downgrade anything?
_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
Drewgrange
Guru
Guru


Joined: 29 Mar 2003
Posts: 483
Location: Ohio, US

PostPosted: Sat Sep 18, 2004 3:18 pm    Post subject: Reply with quote

Is it normal that it doesn't work in bash? (I'm guessing it was written for a different shell since it said /bin/zsh)
Back to top
View user's profile Send private message
La`res
Arch/Herd Tester
Arch/Herd Tester


Joined: 11 Aug 2003
Posts: 79
Location: ::0

PostPosted: Sun Sep 19, 2004 1:52 pm    Post subject: Reply with quote

emerge zsh....

If you like bash, you'll love zsh...

(in intrest of full disclosure, I am a zsh Zellot)
_________________
Lares Moreau <lares.moreau@gmail.com>
LRU: 400755 http://counter.li.org
lares/irc.freenode.net
Back to top
View user's profile Send private message
karnesky
Apprentice
Apprentice


Joined: 18 Mar 2004
Posts: 218

PostPosted: Sun Sep 19, 2004 2:52 pm    Post subject: Reply with quote

EzInKy wrote:
So what do we put in /etc/portage/package that tells portage to never downgrade anything?
Nothing will do this--anythig too buggy or ridden with security holes will still be removed from even the unstable branch of portage. I suspect you like having some packages from unstable on a mostly stable system (if you want mostly unstable packages, set ACCEPT_KEYWORDS="~x86" (or whatever) to /etc/make.conf). If my suspicion is correct, add lines to /etc/portage/package.keywords to tell portage to only emerge packages from the unstable branch. They'd look like "app-text/xpdf ~x86"
Back to top
View user's profile Send private message
Entropy42
n00b
n00b


Joined: 05 Mar 2004
Posts: 56

PostPosted: Sun Sep 19, 2004 8:57 pm    Post subject: Reply with quote

karnesky wrote:
EzInKy wrote:
So what do we put in /etc/portage/package that tells portage to never downgrade anything?
Nothing will do this--anythig too buggy or ridden with security holes will still be removed from even the unstable branch of portage. I suspect you like having some packages from unstable on a mostly stable system (if you want mostly unstable packages, set ACCEPT_KEYWORDS="~x86" (or whatever) to /etc/make.conf). If my suspicion is correct, add lines to /etc/portage/package.keywords to tell portage to only emerge packages from the unstable branch. They'd look like "app-text/xpdf ~x86"

The problem is that this will cause the particular package to ALWAYS be ~x86 - In some cases a masked package is chosen because of a critical feature, but the user doesn't want that package to *always* be unstable.

A lot of work with version-specific stuff in packages.mask and packages.unmask will give similar functionality, but at significantly increased effort, and worse, increasing cruft in the packages.* files as packages "catch up" to the version they were bumped to. While these can be cleaned out manually, it's a lot of maintenance compared to emerge -Up to see what will be done followed by emerge -U once you're happy that nothing wonky will be done.
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Sun Sep 19, 2004 10:59 pm    Post subject: Reply with quote

Entropy42 wrote:
karnesky wrote:
EzInKy wrote:
So what do we put in /etc/portage/package that tells portage to never downgrade anything?
Nothing will do this--anythig too buggy or ridden with security holes will still be removed from even the unstable branch of portage. I suspect you like having some packages from unstable on a mostly stable system (if you want mostly unstable packages, set ACCEPT_KEYWORDS="~x86" (or whatever) to /etc/make.conf). If my suspicion is correct, add lines to /etc/portage/package.keywords to tell portage to only emerge packages from the unstable branch. They'd look like "app-text/xpdf ~x86"

The problem is that this will cause the particular package to ALWAYS be ~x86 - In some cases a masked package is chosen because of a critical feature, but the user doesn't want that package to *always* be unstable.

A lot of work with version-specific stuff in packages.mask and packages.unmask will give similar functionality, but at significantly increased effort, and worse, increasing cruft in the packages.* files as packages "catch up" to the version they were bumped to. While these can be cleaned out manually, it's a lot of maintenance compared to emerge -Up to see what will be done followed by emerge -U once you're happy that nothing wonky will be done.


that made no sense at all. you seem to have "keyword" and "masked" mixed up, additionally.
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
kavau
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 87

PostPosted: Sun Sep 19, 2004 11:26 pm    Post subject: Reply with quote

Entropy42 wrote:
karnesky wrote:
(...) If my suspicion is correct, add lines to /etc/portage/package.keywords to tell portage to only emerge packages from the unstable branch. They'd look like "app-text/xpdf ~x86"

The problem is that this will cause the particular package to ALWAYS be ~x86 - In some cases a masked package is chosen because of a critical feature, but the user doesn't want that package to *always* be unstable.

A lot of work with version-specific stuff in packages.mask and packages.unmask will give similar functionality, but at significantly increased effort, and worse, increasing cruft in the packages.* files as packages "catch up" to the version they were bumped to. While these can be cleaned out manually, it's a lot of maintenance compared to emerge -Up to see what will be done followed by emerge -U once you're happy that nothing wonky will be done.

What's the problem? Just add a line like "=app-text/xpdf-2.1 ~x86" to your /etc/portage/package.keywords. This allows you to install version 2.1 if it's still unstable, but won't upgrade to any version beyond that unless that version becomes stable. The only maintenance you'll have to do is cleaning out ancient entries in your /etc/portage/package.keywords file every now and then, but even that is optional, since the ancient entries won't do any harm.

Or, even, better, "<app-text/xpdf-2.2 ~x86" would install bugfix versions like 2.1.1 as well, but will not install 2.2 unless it becomes stable. (Disclaimer: haven't tried this actually, but this is how it should work)
_________________
Brain surgeon general's warning: reading books and magazines may be hazardous to your ignorance.
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1734
Location: Kentucky

PostPosted: Mon Sep 20, 2004 9:09 pm    Post subject: Reply with quote

karnesky wrote:
EzInKy wrote:
So what do we put in /etc/portage/package that tells portage to never downgrade anything?
Nothing will do this--anythig too buggy or ridden with security holes will still be removed from even the unstable branch of portage. I suspect you like having some packages from unstable on a mostly stable system (if you want mostly unstable packages, set ACCEPT_KEYWORDS="~x86" (or whatever) to /etc/make.conf). If my suspicion is correct, add lines to /etc/portage/package.keywords to tell portage to only emerge packages from the unstable branch. They'd look like "app-text/xpdf ~x86"


No, you suspect wrong. I enjoy running an unstable system and ACCEPT_KEYWORDS="~x86" has been in my make.conf for nearly two years now, and I really don't want to put my whole world file in /etc/portage.
_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
karnesky
Apprentice
Apprentice


Joined: 18 Mar 2004
Posts: 218

PostPosted: Tue Sep 21, 2004 2:34 am    Post subject: Reply with quote

EzInKy wrote:
No, you suspect wrong. I enjoy running an unstable system and ACCEPT_KEYWORDS="~x86" has been in my make.conf for nearly two years now, and I really don't want to put my whole world file in /etc/portage.
So what exactly is the big deal? The fact that you have set ACCEPT_KEYWORDS="~x86" in your make.conf means you don't nead to put your whole world file in /etc/portage/accept_keywords. Any downgrades that are likely to come would be borked packages which were removed from the unstable branch. Are you saying you want borked packages :?:
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1734
Location: Kentucky

PostPosted: Tue Sep 21, 2004 3:04 am    Post subject: Reply with quote

karnesky wrote:
EzInKy wrote:
No, you suspect wrong. I enjoy running an unstable system and ACCEPT_KEYWORDS="~x86" has been in my make.conf for nearly two years now, and I really don't want to put my whole world file in /etc/portage.
So what exactly is the big deal? The fact that you have set ACCEPT_KEYWORDS="~x86" in your make.conf means you don't nead to put your whole world file in /etc/portage/accept_keywords. Any downgrades that are likely to come would be borked packages which were removed from the unstable branch. Are you saying you want borked packages :?:

If it's already on my system, my system is already borked isn't it? Besides, how does a package get "unborked" if you don't have people testing it and giving feedback as to why it works on one system and not another and give people the opportunity to work on a fix the way they have been instead of whisking it away? Really, all I'm saying is that Portage should respect a users wishes and not automatically downgrade anything if the user specifically tells it not to downgrade anything.
_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
kavau
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jul 2004
Posts: 87

PostPosted: Tue Sep 21, 2004 3:25 am    Post subject: Reply with quote

EzInKy wrote:
If it's already on my system, my system is already borked isn't it? Besides, how does a package get "unborked" if you don't have people testing it and giving feedback as to why it works on one system and not another and give people the opportunity to work on a fix the way they have been instead of whisking it away? Really, all I'm saying is that Portage should respect a users wishes and not automatically downgrade anything if the user specifically tells it not to downgrade anything.

I have to repeat karnesky's question: what's the big deal? Packages only get downgraded if it is found that they are seriously flawed. In that case you probably wouldn't want to have them on your system. And a package doesn't get "unborked" by more testing if the flaw has been found already. The best solution is often to withdraw the package, fix the bug, and then try again. Mind that this only happens with serious flaws.

If you think that this is "censorship" then fine, use the -U flag and be happy, nothing wrong with that. Gentoo does respect your wishes there. The -u flag basically means "I believe that the developers know what's good for me, so if they say a package is borked, remove it." It's completely up to you, so everybody should be content.
_________________
Brain surgeon general's warning: reading books and magazines may be hazardous to your ignorance.
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1734
Location: Kentucky

PostPosted: Tue Sep 21, 2004 3:47 am    Post subject: Reply with quote

kavau wrote:

I have to repeat karnesky's question: what's the big deal? Packages only get downgraded if it is found that they are seriously flawed. In that case you probably wouldn't want to have them on your system. And a package doesn't get "unborked" by more testing if the flaw has been found already. The best solution is often to withdraw the package, fix the bug, and then try again. Mind that this only happens with serious flaws.

If you think that this is "censorship" then fine, use the -U flag and be happy, nothing wrong with that. Gentoo does respect your wishes there. The -u flag basically means "I believe that the developers know what's good for me, so if they say a package is borked, remove it." It's completely up to you, so everybody should be content.


Bugs get fixed by people finding and fixing them, and when you simply up and remove a buggy package you reduce the number of people who could be working on finding the fixes.

Quote:

The -u flag basically means "I believe that the developers know what's good for me


I thought we were talking about an open source system here B-)

Quote:

It's completely up to you, so everybody should be content.


Isn't leaving it up to the user to decide if he wants borked packages removed by having the -U option exactly what we are discussing?
_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
La`res
Arch/Herd Tester
Arch/Herd Tester


Joined: 11 Aug 2003
Posts: 79
Location: ::0

PostPosted: Wed Sep 22, 2004 2:48 am    Post subject: Reply with quote

I felt it is safer for me to have the -U option removed. So I removed it.. If you want it. It's only one Character away... or if you use vi... iU^] :)
_________________
Lares Moreau <lares.moreau@gmail.com>
LRU: 400755 http://counter.li.org
lares/irc.freenode.net
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
Page 1 of 1

 
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