FS#7208 - Request pacman query for all packages that aren't required by other pkgs.

Attached to Project: Pacman
Opened by hans (kryo) - Saturday, 19 May 2007, 03:08 GMT
Last edited by Dan McGee (toofishes) - Thursday, 10 January 2008, 13:58 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To Aaron Griffin (phrakture)
Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version 3.0.6
Due in Version 3.1.0
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

As of pacman3, -Qe "list all packages installed as a dependency but no longer required by any package" according to the manpage.

I'd like to request for a Pacman Query functionality that lists all packages (explicitly installed or installed as a dep) that are not required by any other package.

Thanks!
This task depends upon

Closed by  Dan McGee (toofishes)
Thursday, 10 January 2008, 13:58 GMT
Reason for closing:  Implemented
Additional comments about closing:  Implemented, versions on bug are now set too
Comment by Roman Kyrylych (Romashka) - Saturday, 19 May 2007, 12:00 GMT Comment by Xavier (shining) - Saturday, 19 May 2007, 13:07 GMT
Would it be ok to get this feature with pacman -Qee ?
I'm attaching a patch that does that.
Comment by Aaron Griffin (phrakture) - Sunday, 20 May 2007, 06:20 GMT Comment by Scott H (stonecrest) - Sunday, 20 May 2007, 22:49 GMT
As mentioned on irc, -Qe (and -Qee) should perhaps also display packages up the hierarchy. In other words, if you install foo, where foo depends on bar and bar depends on baz, and then uninstall foo, both bar and baz are technically orphaned, not just bar.
Comment by Travis Willard (Cerebral) - Tuesday, 03 July 2007, 16:48 GMT
Heh, pacman -Qer and/or -Qeer (recursive)?
Comment by Xavier (shining) - Tuesday, 03 July 2007, 21:28 GMT
That's exactly what the _alpm_removedeps function from libalpm/deps.c does. It's used for -Rs (recursive) already.
Once you have the list of orphans, you just call _alpm_removedeps(list_orphans) , and it gives you what you want :)
Comment by Jason Robinson (archuser) - Sunday, 12 August 2007, 09:46 GMT
What if a package isn't required by another package but is essential to the system? Would there be some kind of built in failsafe so that those packages don't get listed?
Comment by Dan McGee (toofishes) - Monday, 20 August 2007, 20:00 GMT
Xavier, does the new query options stuff implement the "traversing the hierarchy" stuff? Or do we need to break out some sort of recurse_deps function?
Comment by Xavier (shining) - Monday, 20 August 2007, 20:11 GMT
No, I didn't implement this.

I had a little problem with it:
most other query options allow to filter and display in line.

While with this option, it would first require to do all computations : first build the list of orphans, then call alpm_recursedeps on it (after exporting it),
and then only display the resulting list.

Loading...