Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
"Gentoo does not handle reverse dependencies"? means what?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
massysett
Apprentice
Apprentice


Joined: 06 Jan 2006
Posts: 296
Location: Silver Spring, Maryland USA

PostPosted: Tue Apr 18, 2006 2:37 am    Post subject: "Gentoo does not handle reverse dependencies"? mea Reply with quote

People often say that Portage does not handle reverse dependencies. See for example here. Or see here on Gentoo Wiki.

What does this mean, exactly, when people say that? For instance Gentoo Wiki says you can break your whole system by unmerging glibc. Of course this would be hard to inadvertently do as glibc is in the system list. But I always do
Code:
equery d packagename
before I unmerge anything. If that command spits out anything--duh--don't unmerge the package.

Sometimes emerges can break linking, but that's what revdep-rebuild is for. It works fine for me, though it does give strange output for openoffice-bin.[/code]

So what do people mean, Portage doesn't handle reverse dependencies? Am I missing something? Is all that people mean is, they want emerge to check for dependencies before unmerging?
_________________
Draft Windows-to-Linux Guide
Back to top
View user's profile Send private message
Q-collective
Advocate
Advocate


Joined: 22 Mar 2004
Posts: 2071

PostPosted: Tue Apr 18, 2006 2:38 am    Post subject: Reply with quote

A simple example of what is meant with it:
Code:
emerge kde-meta

Now, try to unmerge all of that ;)
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Apr 18, 2006 4:15 am    Post subject: Reply with quote

Even better than above, is unmerging package X, which has dependency Y, but NOT unmerging Y, because A, F and M also depend on Y.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Tue Apr 18, 2006 4:53 am    Post subject: Reply with quote

I would do something like:

emerge -p --nospinner kde-meta > whackit.sh 2>&1
vi whackit.sh (spend a few minutes cutting, pasting, and inserting column blocks)

Then when I was done playing with kde, I would use the script I hacked together to remove it. (one big emerge -C pretty much)

If I was being really lazy, I would just make a stage4 backup, then format and restore later.
_________________
Bones McCracker wrote:
On the other hand, regex is popular with the ladies.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Apr 18, 2006 6:37 am    Post subject: Reply with quote

yabbadabbadont wrote:
vi whackit.sh (spend a few minutes cutting, pasting, and inserting column blocks)
Make a pass (or few) through sed. Takes much less time.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
omp
Retired Dev
Retired Dev


Joined: 10 Sep 2005
Posts: 1018
Location: Glendale, California

PostPosted: Tue Apr 18, 2006 7:34 am    Post subject: Reply with quote

I just use ecatmur's dep script for reverse dependancies.
_________________
meow.
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Tue Apr 18, 2006 9:16 pm    Post subject: Reply with quote

pjp wrote:
yabbadabbadont wrote:
vi whackit.sh (spend a few minutes cutting, pasting, and inserting column blocks)
Make a pass (or few) through sed. Takes much less time.


Only if you already are an expert at regular expressions and using sed....
_________________
Bones McCracker wrote:
On the other hand, regex is popular with the ladies.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Apr 18, 2006 10:49 pm    Post subject: Reply with quote

yabbadabbadont wrote:
Only if you already are an expert at regular expressions and using sed....
It isn't that difficult to do this type of sed/awk. I'm no expert. I just followed some guides and worked at it.

Here's an example for xorg-x11 7:
Code:
emerge -pq --nocolor xorg-x11 | grep -v "blocks B" | sed -e 's/\[ebuild [A-Z ]*\] /=/g' | awk '{ print $1 }'
  • The 'q' option eliminates the trailing "USE" info, though it isn't really necessary for this method.
  • Since X 7 is blocked by 6.x, I just used grep to exclude the blockers, sending the list of "new" stuff to sed.
  • 's' in sed is for search and replace, and takes the form of: s/search term/replace with/g 'g' refers to a global (line?) search IIRC.
  • \[ and \] "escape" the [ and ] characters, as they have special meaning. Since the output begins with [ebuild we want that [ to be "replaced." That is what "escaping" refers to. Notice the next set, [A-Z ], which refers to all capitalized letters A through Z, including a space at the end. This pair of [] is interpreted as being special, because they aren't escaped. The following * says "match any number of the characters in the set (the set is A-Z plus space). I replace the beginning info with an = which is required (or >, <, >=, <=) when (un)masking specific versions.
  • The awk line prints the first "column" of info, which happens to be the category/package-version info. It excludes the trailing old version in brackets, since it would be in "column 2" (delimited by spaces).


Play around with sed and awk to see what they do. You can start with "By Example" articles at: http://www.gentoo.org/doc/en/list.xml (search for "by example"). There is also a series for bash.

Make notes as you go along, because you'll probably discover things that aren't easy to remember until you use it regularly (I almost always have to "refresh" my memory on how to do certain stuff, especially the [A-Z ] parts).
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Tue Apr 18, 2006 10:52 pm    Post subject: Reply with quote

Too much work. I'll just spend 5 minutes (at most) in vi and have it done...
_________________
Bones McCracker wrote:
On the other hand, regex is popular with the ladies.
Back to top
View user's profile Send private message
Fitzzy
n00b
n00b


Joined: 07 Nov 2005
Posts: 17
Location: Fitzville

PostPosted: Wed Apr 19, 2006 2:51 am    Post subject: Reply with quote

It is a very nice feature to have, reverse dependencies, but it is orders of magnitude more difficult to implement than a normal forward dependency handling.
Back to top
View user's profile Send private message
Master_Of_Disaster
l33t
l33t


Joined: 28 Feb 2003
Posts: 610
Location: 15.05072° East, 48.13747° North (aka Mauer), Austria

PostPosted: Wed Apr 19, 2006 10:57 am    Post subject: Reply with quote

And what about
Code:
emerge -C <package> && emerge depclean
?
Given that your world file is sane, shouldn't this take care of removing unwanted dependencies of <package>?
_________________
post tenebras lux, post fenestras tux
Registered Linux User Nr. 312509
Adopt an unanswered post today!
Back to top
View user's profile Send private message
Q-collective
Advocate
Advocate


Joined: 22 Mar 2004
Posts: 2071

PostPosted: Wed Apr 19, 2006 11:41 am    Post subject: Reply with quote

Fitzzy wrote:
It is a very nice feature to have, reverse dependencies, but it is orders of magnitude more difficult to implement than a normal forward dependency handling.

It is not hard, it just requires rewriting a lot of portage ;)
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Wed Apr 19, 2006 2:28 pm    Post subject: Reply with quote

Fitzzy wrote:
It is a very nice feature to have, reverse dependencies, but it is orders of magnitude more difficult to implement than a normal forward dependency handling.

Actually, given a sane underlying model and classes, it's a heck of a lot easier. The main reason Portage doesn't have it is that Portage doesn't have a sane underlying model or classes.
Back to top
View user's profile Send private message
ferringb
Retired Dev
Retired Dev


Joined: 03 Apr 2003
Posts: 357

PostPosted: Wed Apr 19, 2006 7:11 pm    Post subject: Reply with quote

Fitzzy wrote:
It is a very nice feature to have, reverse dependencies, but it is orders of magnitude more difficult to implement than a normal forward dependency handling.

Actually... :)

Proper resolver has to back track and yank pulled in dependencies when a particular branch it was executing turned out to be unsatisfiable. Revdep's are the same thing- load up full graph, yoink the desired node, and iterate till the graph stabilizes/completes. Depending on your design, either you tracked the info as you went, or you just difference the two state graphs, then start the removing. ;)
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Wed Apr 19, 2006 9:47 pm    Post subject: Reply with quote

Split off the Portage is NOT Gentoo discussion.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
omp
Retired Dev
Retired Dev


Joined: 10 Sep 2005
Posts: 1018
Location: Glendale, California

PostPosted: Thu Apr 20, 2006 12:44 am    Post subject: Reply with quote

Master_Of_Disaster wrote:
And what about
Code:
emerge -C <package> && emerge depclean
?
Given that your world file is sane, shouldn't this take care of removing unwanted dependencies of <package>?
The outcome of depclean isn't always too nice. Make sure to go over the list first. ;)
_________________
meow.
Back to top
View user's profile Send private message
lynxnyl
Apprentice
Apprentice


Joined: 15 Aug 2004
Posts: 253
Location: Ljubljana, Slovenija

PostPosted: Thu Apr 20, 2006 7:41 pm    Post subject: Reply with quote

Yeah, reverse dependencies, triggers, conflict resolution (...) are all great features. Too bad gent^Wportage doesn't have them, this makes package managment a lot easier/faster.
_________________
Have a sorcerous day!
Back to top
View user's profile Send private message
ewan.paton
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1219
Location: glasgow, scotland

PostPosted: Thu Apr 20, 2006 8:59 pm    Post subject: Reply with quote

i remember some time ago there was a project about putting the bckend of portage into an sql database, i would imagine revers dependance would be a hell of a lot easier with a table of installed packages, each ebuild being used as a row with its dependences, a table of instaled packages and some sql magic.

unfortunaly last i heard about the project was sever years ago and im not a developer so could be talking out my ass about how easy it would be, also it would require a database as part of the base system.
_________________
Giay tay nam | Giay nam cao cap | Giay luoi


Last edited by ewan.paton on Thu Dec 11, 2014 7:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
lynxnyl
Apprentice
Apprentice


Joined: 15 Aug 2004
Posts: 253
Location: Ljubljana, Slovenija

PostPosted: Fri Apr 21, 2006 9:38 am    Post subject: Reply with quote

One can use a text based database. With these numbers it is bordering on being inefficient, but that is much better than bringing in the overhead of a "real" db.

Doesn't portage already cache some of the info? I think that's it.
_________________
Have a sorcerous day!
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9533
Location: beyond the rim

PostPosted: Fri Apr 21, 2006 3:20 pm    Post subject: Reply with quote

Sigh, "reverse dependencies" aren't a feature.
Back to top
View user's profile Send private message
lynxnyl
Apprentice
Apprentice


Joined: 15 Aug 2004
Posts: 253
Location: Ljubljana, Slovenija

PostPosted: Fri Apr 21, 2006 3:29 pm    Post subject: Reply with quote

I think it is obvious people are talking about unmerge dependency handling.
_________________
Have a sorcerous day!
Back to top
View user's profile Send private message
calr0x
Apprentice
Apprentice


Joined: 16 Aug 2004
Posts: 244

PostPosted: Sat Nov 18, 2006 6:02 am    Post subject: Reply with quote

Genone wrote:
Sigh, "reverse dependencies" aren't a feature.


I'ma let ya in on a lil' tip here.. That's some nerd shit there...
_________________
Edit the subject of the original post w/ [SOLVED] at the end if this thread is resolved.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9533
Location: beyond the rim

PostPosted: Sat Nov 18, 2006 8:19 am    Post subject: Reply with quote

calr0x wrote:
Genone wrote:
Sigh, "reverse dependencies" aren't a feature.


I'ma let ya in on a lil' tip here.. That's some nerd shit there...

Thanks for that constructive comment. Certainly motivates me to put more work into portage.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Sat Nov 18, 2006 8:49 pm    Post subject: Reply with quote

Nevermind him... just get the "you probably mean" parts working :D
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Sat Nov 18, 2006 9:02 pm    Post subject: Reply with quote

lynxnyl wrote:
I think it is obvious people are talking about unmerge dependency handling.

I think it's obvious that people are talking about all kinds of things.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat 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