View previous topic :: View next topic |
Author |
Message |
La`res Arch/Herd Tester
Joined: 11 Aug 2003 Posts: 79 Location: ::0
|
Posted: Tue Jul 27, 2004 3:00 pm Post subject: lemerge : A script to update everthing possible. |
|
|
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 |
|
|
Rainmaker Veteran
Joined: 12 Feb 2004 Posts: 1650 Location: /home/NL/ehv/
|
Posted: Tue Jul 27, 2004 5:07 pm Post subject: |
|
|
How's this different from emerge -uD? _________________ If you can't dazzle them with brilliance, baffle them with bullshit. |
|
Back to top |
|
|
regeya Apprentice
Joined: 28 Jul 2002 Posts: 270 Location: Desoto, IL, USA
|
Posted: Tue Jul 27, 2004 5:10 pm Post subject: |
|
|
Rainmaker wrote: | How's this different from emerge -uD? |
Reading the script would tell you...it seems to be well-documented... 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 |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Wed Jul 28, 2004 3:33 am Post subject: |
|
|
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 |
|
|
crafteh n00b
Joined: 30 Mar 2004 Posts: 29
|
Posted: Wed Jul 28, 2004 5:01 am Post subject: |
|
|
what's wrong with using --updateonly ? |
|
Back to top |
|
|
kamagurka Veteran
Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Wed Jul 28, 2004 12:25 pm Post subject: |
|
|
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 |
|
|
EzInKy Veteran
Joined: 11 Oct 2002 Posts: 1742 Location: Kentucky
|
Posted: Tue Aug 10, 2004 2:35 am Post subject: |
|
|
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 |
|
|
Drewgrange Guru
Joined: 29 Mar 2003 Posts: 483 Location: Ohio, US
|
Posted: Sat Sep 18, 2004 3:18 pm Post subject: |
|
|
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 |
|
|
La`res Arch/Herd Tester
Joined: 11 Aug 2003 Posts: 79 Location: ::0
|
Posted: Sun Sep 19, 2004 1:52 pm Post subject: |
|
|
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 |
|
|
karnesky Apprentice
Joined: 18 Mar 2004 Posts: 218
|
Posted: Sun Sep 19, 2004 2:52 pm Post subject: |
|
|
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 |
|
|
Entropy42 n00b
Joined: 05 Mar 2004 Posts: 56
|
Posted: Sun Sep 19, 2004 8:57 pm Post subject: |
|
|
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 |
|
|
kamagurka Veteran
Joined: 25 Jan 2004 Posts: 1026 Location: /germany/munich
|
Posted: Sun Sep 19, 2004 10:59 pm Post subject: |
|
|
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 |
|
|
kavau Tux's lil' helper
Joined: 28 Jul 2004 Posts: 87
|
Posted: Sun Sep 19, 2004 11:26 pm Post subject: |
|
|
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 |
|
|
EzInKy Veteran
Joined: 11 Oct 2002 Posts: 1742 Location: Kentucky
|
Posted: Mon Sep 20, 2004 9:09 pm Post subject: |
|
|
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 |
|
|
karnesky Apprentice
Joined: 18 Mar 2004 Posts: 218
|
Posted: Tue Sep 21, 2004 2:34 am Post subject: |
|
|
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 |
|
|
EzInKy Veteran
Joined: 11 Oct 2002 Posts: 1742 Location: Kentucky
|
Posted: Tue Sep 21, 2004 3:04 am Post subject: |
|
|
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 |
|
|
kavau Tux's lil' helper
Joined: 28 Jul 2004 Posts: 87
|
Posted: Tue Sep 21, 2004 3:25 am Post subject: |
|
|
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 |
|
|
EzInKy Veteran
Joined: 11 Oct 2002 Posts: 1742 Location: Kentucky
|
Posted: Tue Sep 21, 2004 3:47 am Post subject: |
|
|
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 |
|
|
La`res Arch/Herd Tester
Joined: 11 Aug 2003 Posts: 79 Location: ::0
|
Posted: Wed Sep 22, 2004 2:48 am Post subject: |
|
|
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 |
|
|
|