Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Check World Updates
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Nimue
Tux's lil' helper
Tux's lil' helper


Joined: 17 Sep 2006
Posts: 88

PostPosted: Tue Aug 12, 2008 9:10 pm    Post subject: Check World Updates Reply with quote

Figured I'd help you all out a little. Sometimes, if you notice, things that you have installed that can be updated won't get picked up by -Du world, -ep world, -Dupe world, or what have you. As such, I wrote a simple brute-force script to pick up these packages so as to maintain a consistently updated environment.


file: check_world_updates.sh
Code:

#!/bin/bash
#A simple script to check every package in the system and see if it can be updated, while skipping any issues you have with masked packages and all of that.
#Written by Nimue

if [ "$1" == "--help" ]; then
   echo -e "This is a simple script used to check all the packages in your system for updates, for those nasty ones that are installed,\nbut not recorded in the world profile for some reason\n\nUsage: -o X output to file X\nOtherwise it will not output anywhere and will simply return the results";
   exit 1;

elif [ "$1" == "-o" ]; then
   for i in `ls /usr/portage/*/* --ignore="*metadata.xml" -d | cut -d / -f 4-5 | grep -v metadata.xml | grep -v licenses | grep -v "local/layman"`; do emerge $i -p | grep "ebuild     U" | grep -v "ebuild     UD"  |  cut -d " " -f 8 >> $2; done;
   exit 1;

elif [ "$1" == "" ]; then
   for i in `ls /usr/portage/*/* --ignore="*metadata.xml" -d | cut -d / -f 4-5 | grep -v metadata.xml | grep -v licenses | grep -v "local/layman"`; do emerge $i -p | grep "ebuild     U" | grep -v "ebuild     UD"  |  cut -d " " -f 8; done;
   exit 1;
else
   echo "Invalid Argument";
fi



#Lazy way
#ls /usr/portage/*/* --ignore="*metadata.xml" -d | cut -d / -f 4-5 | grep -v metadata.xml | grep -v licenses | grep -v "local/layman" > /tmp/blah.info && \
#for i in `cat /tmp/blah.txt`; do emerge $i -p | grep "ebuild     U" |  grep -v "ebuild     UD" | cut -d " " -f 8; done


Last edited by Nimue on Sat Aug 16, 2008 6:12 am; edited 3 times in total
Back to top
View user's profile Send private message
slackline
Veteran
Veteran


Joined: 01 Apr 2005
Posts: 1423
Location: /uk/sheffield

PostPosted: Tue Aug 12, 2008 11:03 pm    Post subject: Reply with quote

Looks useful, only realised reading a thread the other day that portage misses things occasionally when you emerge -uDNa world.

Cheers,

slack
_________________
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Back to top
View user's profile Send private message
Nimue
Tux's lil' helper
Tux's lil' helper


Joined: 17 Sep 2006
Posts: 88

PostPosted: Wed Aug 13, 2008 4:58 am    Post subject: Reply with quote

slack---line wrote:
Looks useful, only realised reading a thread the other day that portage misses things occasionally when you emerge -uDNa world.

Cheers,

slack


Well if you don't mind, try syncing so you have some packages and then running it to make sure. Also make sure you output to a file. In all logical sense it should work, but I've only sort of tested it on smaller sections of stuff. So yeah, give it a go and give me feedback. I'd also like to append a = at the beginning of every line of the output file so as to facilitate an emerge `cat X` thinger. However, I only really know how to append to the END of lines with sed. So yeah...
Back to top
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 04 Nov 2004
Posts: 1083
Location: Victoria, BC, Canada

PostPosted: Wed Aug 13, 2008 3:13 pm    Post subject: Reply with quote

slack---line wrote:
Looks useful, only realised reading a thread the other day that portage misses things occasionally when you emerge -uDNa world.

Try emerge -uavND1 --with-bdeps y @world @system (or just world if you're not running a portage-2.2 rc yet).
_________________
Saving the world, one kilobyte at a time.
Back to top
View user's profile Send private message
dol-sen
Developer
Developer


Joined: 30 Jun 2002
Posts: 2803
Location: Richmond, BC, Canada

PostPosted: Thu Aug 14, 2008 12:09 am    Post subject: Reply with quote

Not trying to steal your thunder, but for those that want this in a gui interface, porthole gives you a complete listing of all upgradeable packages. Just select the "Upgradeable Packages" view. They will be broken into one of (System, Sets, World, Dependencies). It also keeps system and sets packages out of the world list to avoid duplication.

Just remember:

When upgrading dependencies it is advisable to run revdep-rebuild to keep things working. Most times all is fine, but sometimes things break.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
Nimue
Tux's lil' helper
Tux's lil' helper


Joined: 17 Sep 2006
Posts: 88

PostPosted: Thu Aug 14, 2008 1:00 am    Post subject: Reply with quote

dol-sen wrote:
Not trying to steal your thunder, but for those that want this in a gui interface, porthole gives you a complete listing of all upgradeable packages. Just select the "Upgradeable Packages" view. They will be broken into one of (System, Sets, World, Dependencies). It also keeps system and sets packages out of the world list to avoid duplication.

Just remember:

When upgrading dependencies it is advisable to run revdep-rebuild to keep things working. Most times all is fine, but sometimes things break.


Question is, will it also show you the packages emerge -Dup world won't? Or those that -ep world | grep U or whatever won't? Doubtful, but I can attest neither way (actually I can and it doesn't work, see below comment). Also, is it worth using a GUI for?

Also, the above command
emerge -uavND1 --with-bdeps y @world @system -p
Did not list some of the ones my script pulled out.

edit: Just checked porthole.- also did not pick up many of the packages. The above command pulled out more. Porthole doesn't even deep search world for updates. The command it runs is basically just emerge -u world (and it turns off the spinner). Not efficient at all.

So it looks like my script is still the best way available. Unfortunately, it is satanically slow. I have also verified that my script is operational. The output format was a bit more odd than I expected, but it did work.

edit 2: Just updated the script so as to remove formatting issues.
Back to top
View user's profile Send private message
dol-sen
Developer
Developer


Joined: 30 Jun 2002
Posts: 2803
Location: Richmond, BC, Canada

PostPosted: Thu Aug 14, 2008 7:30 am    Post subject: Reply with quote

If you just click the upgrades icon and answer "Yes" to update world, then that is all you get (it is an old command that has not been updated along with portage feature enhancements). If you select "NO" then it will give you the itemized breakdown of everything installed on your system that has an update available according to your keyword settings. The better way is to select the "Upgradeable Packages" view from the view selector just above the categories listings. It will bring you directly to the detailed listings where you can select all or only the ones you wish to update, then click the update icon to queue them in the terminal. There is also a "Deprecated Packages" view for the installed packages/ebuilds no longer in the tree or overlays on your system.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
Nimue
Tux's lil' helper
Tux's lil' helper


Joined: 17 Sep 2006
Posts: 88

PostPosted: Fri Aug 15, 2008 6:52 am    Post subject: Reply with quote

dol-sen wrote:
If you just click the upgrades icon and answer "Yes" to update world, then that is all you get (it is an old command that has not been updated along with portage feature enhancements). If you select "NO" then it will give you the itemized breakdown of everything installed on your system that has an update available according to your keyword settings. The better way is to select the "Upgradeable Packages" view from the view selector just above the categories listings. It will bring you directly to the detailed listings where you can select all or only the ones you wish to update, then click the update icon to queue them in the terminal. There is also a "Deprecated Packages" view for the installed packages/ebuilds no longer in the tree or overlays on your system.


So it does. Still don't want porthole installed on my system though. I'm minimalistic as hell and want as little installed as possible. However, do you know how it does this? If possible I'd like to find out. Especially for those of us who run servers without X installed - and those who just hate GUIs (both apply to me).
Back to top
View user's profile Send private message
dol-sen
Developer
Developer


Joined: 30 Jun 2002
Posts: 2803
Location: Richmond, BC, Canada

PostPosted: Fri Aug 15, 2008 7:38 am    Post subject: Reply with quote

Heh, gui's are not for everyone or everything, but they are better for some things.

What do you want to know about? The upgrades? the Deprecated list?

When porthole starts it uses portage to obtain the installed list, the entire tree list. It then checks for any installed packages/ebuilds that are no longer in any tree (portage tree, overlays) on your system to produce the deprecated list. For the upgrades it uses the installed list and checks each package for available up/downgrades then puts them in the first qualifying category (System, Sets (alphabetical set-name order), World, Dependencies). The reason it builds it's lists quicker than portage is because it loads it's package database once, then performs the the upgrades/deprecated list build from the already loaded database and program modules. Emerge and other related command line tools have to load and initialize their program modules and database each time they are run, making them slower for repeated commands with different parameters like searching for packages. An interactive emerge would be very fast for repeated search queries, since it's program modules are already loaded and initialized as well as the database loaded.

That is why at least one of the portage devs would like to make portage be able to run as a daemon.

If you know some python coding and want to know more how porthole is doing it. Let me know what your interested in and I will tell you where in the code to look.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri Aug 15, 2008 7:54 am    Post subject: Reply with quote

Nimue wrote:
So it does. Still don't want porthole installed on my system though. I'm minimalistic as hell and want as little installed as possible. However, do you know how it does this? If possible I'd like to find out. Especially for those of us who run servers without X installed - and those who just hate GUIs (both apply to me).

Hmm I know where you're coming from, that's why I've spent so long on update, but in terms of maintaining your machine, you should be running --depclean. If it's not a dep (ie if you can't get it with all those options given) of something in world, it either should be in world (or a set included in world yeuch ;) which running -p --depclean will bring to your attention, or it's cruft and you should just get rid of it. (Usually an old dependency that isn't a dep of anything installed anymore.)
You can also do emerge -Cq --depclean <package> to uninstall stuff (it's what we recommend in update -h.)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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