Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[obsolete] update deeper than --deep
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
gnumake
n00b
n00b


Joined: 25 Jul 2002
Posts: 14
Location: AZ, USA

PostPosted: Fri Dec 13, 2002 11:24 am    Post subject: [obsolete] update deeper than --deep Reply with quote

mod edit: This thread is obsolete, --deep has been fixed a long time ago and does what you want. See GF16: Corrupt or empty world file, what do I do? if not.
--Earthwings 2006/01/22


I found that emerge -u --deep world did not update everything. So I
wrote a python script that checks all installed packages with qpkg -I
It takes about a second per package you have installed ( I have 278 )
It will only do the full test if you have rsync'ed lately.

Here is the skinny:

-you need the qpkg script installed. I think it is installed with gentoolkit

-copy the script below into a folder. It creates 2 files to store stuff in

-run ./script.py (this first time will build the update file list)
running ./script.py again will just print out what is out of date

-then you can run ./script.py [ -p, -f, -u] to pretend, fetch, install
it will pass one argument to emerge so you can do -pf also

It is a good idea to run a (./script -p) before (./script -u) because there
might be some NEW packages installed with the updates. The -p should
show you what its going to install.

I took a guess at getting it to only run the full test after a new rsync, but
if I flubbed it you can force an update with --b arg

Code:
#!/usr/bin/python
import os
import sys
import string
import re
import commands as com

Bash = 'gen.bash.sh'
bf_updates = '_Updates'

message = "These packages are out of date\ntype "+sys.argv[0]+" -u or \
-p or -f to update, pretend, fetch.\nIt tries to update if you have rsync'ed, if it does not you \
 can force it to by using --b\n\n"

def updateBuffers():
   Installed = com.getoutput("qpkg -I -nc")
   Installed = string.split(Installed)
   Len = len(Installed)

   Z = []
   print "You have  "+ `Len`+" packages to check"
   for x in Installed:
      print "checking package "+` Len`
      Len -= 1
      temp = com.getoutput("emerge -p "+x)
      if string.find(temp, r'U ]') != -1:
         Z.append(x+'\n')

   f = open(bf_updates, 'w')
   f.writelines(Z)
   f.close()
   print message
   for x in Z: print x,
   print '\n'

def update_if_older():
   u = com.getstatus(bf_updates)
   u = string.split(u)
   w = com.getstatus("/var/cache/edb/world")
   w = string.split(w)
   if u[5] != w[5]: updateBuffers()
   elif int(u[6]) < int(w[6]): updateBuffers()
   else:
      u = u[7]
      w = w[7]
      if u[0] < w[0]: updateBuffers()
      elif u[0] > w[0]: return
      elif u[1] < w[1]: updateBuffers()
      elif u[1] > w[1]: return
      elif u[3] < w[3]: updateBuffers()
      elif u[3] > w[3]: return
      elif u[4] < w[4]: updateBuffers()

if len(sys.argv) > 1:
   if sys.argv[1] == '--b':
      updateBuffers()
   else:
      update_if_older()
      f = open(bf_updates, 'r')
      for x in f:
         g = open(Bash,'w')
         g.write("#!/bin/bash\n$1 $2 $3 $4 $5 $6 $7 $8 $9\n")
         g.close()
         os.spawnv(os.P_WAIT, Bash, (Bash, 'emerge',sys.argv[1],x))
      f.close()
else :
   update_if_older()
   f = open(bf_updates)
   print message
   for x in f: print x,
   print '\n'
   f.close()

Back to top
View user's profile Send private message
S_aIN_t
Guru
Guru


Joined: 11 May 2002
Posts: 488
Location: Ottawa

PostPosted: Fri Dec 13, 2002 10:53 pm    Post subject: Reply with quote

sounds cool... i will give it a try.. and be sure to post the results..
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Thu Dec 26, 2002 9:50 pm    Post subject: Reply with quote

not bad :)

Code:

gentoo root # ./edeep.py
You have 706 packages to check
checking package 706
checking package 705
checking package 704
---cut---
.
.
.
---cut---
checking package 3
checking package 2
checking package 1
These packages are out of date
type ./edeep.py -u or -p or -f to update, pretend, fetch.
It tries to update if you have rsync'ed, if it does not you can force it to by using --b


dev-java/jikes
dev-util/eclipse-jdt-bin
dev-util/eclipse-platform-bin
dev-util/gob
gnome-base/gdm
media-gfx/gimp
media-libs/svgalib
sys-apps/shadow
sys-devel/gcc-config
x11-base/xfree
x11-themes/sylpheed-iconset


These packages are out of date
type ./edeep.py -u or -p or -f to update, pretend, fetch.
It tries to update if you have rsync'ed, if it does not you can force it to by using --b


dev-java/jikes
dev-util/eclipse-jdt-bin
dev-util/eclipse-platform-bin
dev-util/gob
gnome-base/gdm
media-gfx/gimp
media-libs/svgalib
sys-apps/shadow
sys-devel/gcc-config
x11-base/xfree
x11-themes/sylpheed-iconset



i don't know why it prints twice the output... but it looks like it works not bad.

cheers

SteveB
Back to top
View user's profile Send private message
hook
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1398
Location: Ljubljana, Slovenia

PostPosted: Fri Dec 27, 2002 9:23 am    Post subject: Reply with quote

anyone considered to send a bug report about the --deep flag?!?
_________________
tea+free software+law=hook

(deep inside i'm still a tux's little helper)
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Fri Dec 27, 2002 11:09 pm    Post subject: doing it the shell way :) Reply with quote

another way to get a list of packages wich needs a update is to use a one-liner in the shell:

Code:
for i in `qpkg -I -nc`;do emerge -p $i|grep "U \]"|sed 's/^.*U \] \(.*\)\-[0-9]*\.[0-9]*.*$/\1/g';done


or

Code:
for i in `qpkg -I -nc`;do if (emerge -p $i|grep -q "U \]");then echo $i;fi;done





if you want to update them as well, then use something like this:

Code:
for i in `qpkg -I -nc`;do if (emerge -p $i|grep -q "U \]");then emerge $i;fi;done



cheers

SteveB
Back to top
View user's profile Send private message
castorilo
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 157

PostPosted: Thu Jan 16, 2003 3:14 pm    Post subject: How about this? Reply with quote

Am I missing something, or this would do the trick

to see what needs updating:

Code:
qpkg -I -nc | xargs emerge -up



to update the system:

Code:
qpkg -I -nc | xargs emerge -u



Is there any reason you have such complicated ways to do it?
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Jan 16, 2003 3:28 pm    Post subject: Re: How about this? Reply with quote

paulpach wrote:
Am I missing something, or this would do the trick
Have you actually tested this? It doesn't work for me. This uses the portage directory that the package is in. As in:
Code:
# emerge x11-wm/fluxbox
Get rid of the x11-wm/ part, and I think it would work.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
relyt
Apprentice
Apprentice


Joined: 29 Aug 2002
Posts: 238
Location: Massachusetts

PostPosted: Thu Jan 16, 2003 6:54 pm    Post subject: Reply with quote

hook wrote:
anyone considered to send a bug report about the --deep flag?!?

I thought that, as documented, the --deep flag was only supposed to check package dependencies, and the dependency's dependencies. 3 levels deep in other words, not everything.

By which I mean that I believe it is working as intended.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Jan 16, 2003 9:28 pm    Post subject: Re: How about this? Reply with quote

kanuslupus wrote:
Get rid of the x11-wm/ part, and I think it would work.
Code:
sed -e 's/.*\///g'
Will Get rid of that part, but then this happens:
Code:
# qpkg -I -nc | sed -e 's/.*\///g' | xargs emerge -up     
emerge: the "sync" and "rsync" actions do not support "--pretend."
I'm not all that interested in solving this part. When it gets to the package rsync, it is trying to do a:
Code:
emerge -up rsync

_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
frew
n00b
n00b


Joined: 12 Nov 2002
Posts: 29

PostPosted: Thu Jan 16, 2003 10:24 pm    Post subject: Re: doing it the shell way :) Reply with quote

steveb wrote:
another way to get a list of packages wich needs a update is to use a one-liner in the shell:

Code:
for i in `qpkg -I -nc`;do emerge -p $i|grep "U \]"|sed 's/^.*U \] \(.*\)\-[0-9]*\.[0-9]*.*$/\1/g';done


or

Code:
for i in `qpkg -I -nc`;do if (emerge -p $i|grep -q "U \]");then echo $i;fi;done





if you want to update them as well, then use something like this:

Code:
for i in `qpkg -I -nc`;do if (emerge -p $i|grep -q "U \]");then emerge $i;fi;done



cheers

SteveB


Very nice!
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Fri Jan 17, 2003 1:22 pm    Post subject: Reply with quote

You cna leave the category there in place. qpkg -I -nc | xargs emerge -p works fine for me.
Back to top
View user's profile Send private message
castorilo
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 157

PostPosted: Fri Jan 17, 2003 3:16 pm    Post subject: Re: How about this? Reply with quote

kanuslupus wrote:
paulpach wrote:
Am I missing something, or this would do the trick
Have you actually tested this? It doesn't work for me. This uses the portage directory that the package is in. As in:
Code:
# emerge x11-wm/fluxbox
Get rid of the x11-wm/ part, and I think it would work.


Yes, I have tested this and it works just fine. No need to get rid of the category.

I am using
Code:
 ACCEPT_KEYWORDS="~x86"

in my make.conf. Maybe it does not work in the stable packages. That would answer my question on why the other methods.
Back to top
View user's profile Send private message
JeDi
n00b
n00b


Joined: 10 Feb 2003
Posts: 42
Location: Belgium

PostPosted: Mon Feb 10, 2003 11:38 am    Post subject: Reply with quote

How about this one:
Code:
emerge -up $(qpkg -I -nc | awk '{printf $1 " "}')

Works just fine for me, actually I'm using it now to generate binary packages of all the installed progs (with the -B option in stead of -up).

Greetz,
JeDi
_________________
Greetz,
JeDi
Back to top
View user's profile Send private message
The_Saint
Tux's lil' helper
Tux's lil' helper


Joined: 15 Mar 2004
Posts: 108

PostPosted: Fri May 06, 2005 10:45 am    Post subject: Reply with quote

Isn´t there any easy way to add the dependencies in the world file?
This way a simple emerge -u world command would update everything.
Back to top
View user's profile Send private message
justabssplyr
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2004
Posts: 110

PostPosted: Fri May 06, 2005 11:04 am    Post subject: Reply with quote

adding them to the world file would make sure they're always updated, but thats not what the world file is for.

the world file lists packages explicitly added to the system, not pulled in as dependencies.
Back to top
View user's profile Send private message
iamben
Apprentice
Apprentice


Joined: 10 May 2004
Posts: 275

PostPosted: Sat May 07, 2005 9:32 pm    Post subject: Reply with quote

fyi, qpkg is deprecated in favor of equery. it is even missing from the latest ~x86 gentoolkit. might consider doing this with equery instead so the bleeding edge guys can use it too... and so it wont break as soon as gentoolkit 0.2.1 goes stable.
Back to top
View user's profile Send private message
My_World
Guru
Guru


Joined: 01 Sep 2003
Posts: 339
Location: Kalahari Desert

PostPosted: Sun May 08, 2005 10:45 am    Post subject: Reply with quote

iamben wrote:
fyi, qpkg is deprecated in favor of equery. it is even missing from the latest ~x86 gentoolkit. might consider doing this with equery instead so the bleeding edge guys can use it too... and so it wont break as soon as gentoolkit 0.2.1 goes stable.


It changed form qpkg to quickpkg, installed with gentoolkit, just modify the script to correct the new spelling.
_________________
"Ubuntu" - an African word meaning "Gentoo is too hard for me".
Back to top
View user's profile Send private message
iamben
Apprentice
Apprentice


Joined: 10 May 2004
Posts: 275

PostPosted: Sun May 08, 2005 6:10 pm    Post subject: Reply with quote

quickpkg creates binary packages from what you have already emerged, it is not the same as qpkg.
Back to top
View user's profile Send private message
The_Saint
Tux's lil' helper
Tux's lil' helper


Joined: 15 Mar 2004
Posts: 108

PostPosted: Mon May 09, 2005 11:48 am    Post subject: Reply with quote

justabssplyr wrote:
adding them to the world file would make sure they're always updated, but thats not what the world file is for.

the world file lists packages explicitly added to the system, not pulled in as dependencies.

I can see your point, but I had the impression that the use of emerge -u world is to update everything. I realise now that this functionality is missing, since even the emerge -uD world command may ignore some packages.
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Tue May 10, 2005 6:20 am    Post subject: Reply with quote

Did you guys even bother check the date on the original post and on the next replies? There's a more than two year gap (not to mention a two major portage version gap) between JeDi's post and The_Saint's post. This thread is ancient.
--deep has been fixed a long time ago.
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
mirko_3
l33t
l33t


Joined: 02 Nov 2003
Posts: 605
Location: Birreria

PostPosted: Tue May 10, 2005 7:00 am    Post subject: Reply with quote

But I still managed to find one file which wasn't updated....
_________________
Non fa male! Non fa male!
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Tue May 10, 2005 7:31 am    Post subject: Reply with quote

Hasn't happened to me in a long time (read: over a year). Would that perchance have been a package that would have been shown as removable by emerge -pv --depclean? If yes, then it's not surprising that --deep doesn't update it - it shouldn't update it in the first place since that package is orphaned and should be removed, not updated. Works as designed in this case.
And I seldom use --deep since it more often causes things to break over the medium to long term rather than fixing them.
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
mirko_3
l33t
l33t


Joined: 02 Nov 2003
Posts: 605
Location: Birreria

PostPosted: Tue May 10, 2005 12:01 pm    Post subject: Reply with quote

Nope, I run emerge depclean quite often, and it's not one of those; the package is speech-tools, and qpkg told me that festival (which I do have installed and updated) depends on it ...
_________________
Non fa male! Non fa male!
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Tue May 10, 2005 12:54 pm    Post subject: Reply with quote

That's odd, and not a good sign... I'll try to reproduce it.
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
Sheepdogj15
Guru
Guru


Joined: 07 Jan 2005
Posts: 430
Location: Backyard

PostPosted: Sat Aug 06, 2005 8:20 am    Post subject: Reply with quote

hmm yeah. if you check the man page for emerge, it now says that --deep checks the entire dep. tree.

so yeah, this is obsolete.
_________________
Sheepdog
Why Risk It? | Samba Howto
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 1, 2  Next
Page 1 of 2

 
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