Difference between revisions of "User:Allan/Pacman OptDepends"

From ArchWiki
Jump to: navigation, search
(Created page with '=The Idea= Currently '''optdepends''' in pacman serve no purpose other than informational. It would be good to improve this somewhat. =Example= > pacman -S python Optional dep...')
 
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{out of date | Output related tasks are implemented in pacman-4.1}}
 +
 
=The Idea=
 
=The Idea=
  
Currently '''optdepends''' in pacman serve no purpose other than informational.  It would be good to improve this somewhat.
+
Currently '''optdepends''' in pacman serve no purpose other than informational.  It would be good to "improve" this somewhat.
 +
 
 +
=Current Situation=
 +
 
 +
'''example package with optdepends'''
 +
> pacman -S python
 +
Optional dependencies for python
 +
    tk: for IDLE, pynche and modulator
 +
> pacman -Qi python
 +
Optional Deps : tk: for IDLE, pynche and modulator
 +
 
 +
=How to improve?=
 +
 
 +
Everything marked with ''[done]'' is implemented in the optdep branch of [https://github.com/moben/pacman this repo], but probably won't land in pacman before 4.1.
 +
Please note that this branch is frequently rebased onto (pacman upstream) master, to keep it up to date.
 +
 
 +
 
 +
'''pacman recognises installed optdepends'''  ''[done]''
 +
> pacman -S --asdep tk
 +
> pacman -Qi python
 +
Optional Deps : tk: for IDLE, pynche and modulator [installed]
 +
> pacman -Qi tk
 +
Required By: python (optional)
 +
 
 +
'''information about optdepends is not output if an optdepends package is installed'''  ''[done]''
 +
> pacman -S tk
 +
> pacman -S python
 +
(no optional dependencies notification output)
 +
 
 +
this is also smart when installing both at the same time and does the right thing  ''[done]''
 +
 
 +
information is shown if an option is set in pacman.conf  ''[done]''
 +
> pacman -S tk
 +
> pacman -S python
 +
Optional Deps : tk: for IDLE, pynche and modulator [installed]
 +
 
 +
'''optdepends are not orphans unless a flag is specified'''  ''[done]''
 +
> pacman -Qtd
 +
> pacman -Qtd --optdep
 +
tk 8.5.6-1 (optdepend for python)
 +
 
 +
'''packages which are only optrequired get a nonfatal warning when trying to remove them'''  ''[done]''
 +
> pacman -R tk
 +
checking dependencies...
 +
:: python: optionally requires tk (for IDLE, pynche and modulator)
 +
 +
Remove (1): tk-8.5.10-1
 +
 
 +
'''optdepends can be removed with -Rs'''  ''[done]''
 +
> pacman -Rs python
 +
Remove (2): python-2.6.1-1  tk-8.5.6-1
 +
 
 +
'''optdeps are not recursively removed if there is still a package needing them'''  ''[done]''
 +
 
 +
Suppose tk, python and git are installed. python and git optdepend on tk.
  
=Example=
+
> pacman -Rs git
> pacman -S python
+
checking dependencies...
Optional dependencies for python
+
    tk: for IDLE, pynche and modulator
+
Remove (1): git-1.7.6-1
 +
 +
> pacman -Rs git python
 +
checking dependencies...
 +
 +
Remove (3): git-1.7.6-1 python-3.2.1-1 tk-8.5.10-1
  
> pacman -Qi python
+
Note that this only affects automatic recursion, optdepends can still manually be removed (see above)
Optional Deps : tk: for IDLE, pynche and modulator
+
  
> pacman -S --asdep tk
+
'''if a flag is given, optdeps are recursively removed even if there is still a package needing them'''  ''[done]''
> pacman -Qi python
+
Optional Deps : tk: for IDLE, pynche and modulator (installed)
+
  
> pacman -Qqtd
+
Suppose tk, python and git are installed. python and git optdepend on tk.
> pacman -Qqtd --optdep
+
tk (optdepend for python)
+
  
=Actual changes to make=
+
> pacman -Rs --optdeps git
* pacman recognises installed optdepends when using -Qi
+
checking dependencies...
* pacman includes optdepends as dependencies when looking for orphans (unless flag is specified)
+
:: python: optionally requires tk (for IDLE, pynche and modulator)
* pacman only output information about uninstalled optdepends on package install
+
 +
Remove (2): git-1.7.6-1 tk-8.5.10-1
 +
 +
====Other Ideas====
 +
* A flag/configuration option to install a packages optdepends by default  ''[done]''
 +
* Add option to tell pacman if you want it to ask you about installing each single optdepend  ''[done]''
 +
* Add option to tell pacman to list optdepends even when installed and indicate install status of each  ''[done]''

Latest revision as of 03:39, 15 April 2013

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: Output related tasks are implemented in pacman-4.1 (Discuss in User talk:Allan/Pacman OptDepends#)

The Idea

Currently optdepends in pacman serve no purpose other than informational. It would be good to "improve" this somewhat.

Current Situation

example package with optdepends

> pacman -S python
Optional dependencies for python
    tk: for IDLE, pynche and modulator
> pacman -Qi python
Optional Deps : tk: for IDLE, pynche and modulator

How to improve?

Everything marked with [done] is implemented in the optdep branch of this repo, but probably won't land in pacman before 4.1. Please note that this branch is frequently rebased onto (pacman upstream) master, to keep it up to date.


pacman recognises installed optdepends [done]

> pacman -S --asdep tk
> pacman -Qi python
Optional Deps : tk: for IDLE, pynche and modulator [installed]
> pacman -Qi tk
Required By: python (optional)

information about optdepends is not output if an optdepends package is installed [done]

> pacman -S tk
> pacman -S python
(no optional dependencies notification output)

this is also smart when installing both at the same time and does the right thing [done]

information is shown if an option is set in pacman.conf [done]

> pacman -S tk
> pacman -S python
Optional Deps : tk: for IDLE, pynche and modulator [installed]

optdepends are not orphans unless a flag is specified [done]

> pacman -Qtd
> pacman -Qtd --optdep
tk 8.5.6-1 (optdepend for python)

packages which are only optrequired get a nonfatal warning when trying to remove them [done]

> pacman -R tk
checking dependencies...
:: python: optionally requires tk (for IDLE, pynche and modulator)

Remove (1): tk-8.5.10-1

optdepends can be removed with -Rs [done]

> pacman -Rs python
Remove (2): python-2.6.1-1  tk-8.5.6-1

optdeps are not recursively removed if there is still a package needing them [done]

Suppose tk, python and git are installed. python and git optdepend on tk.

> pacman -Rs git
checking dependencies...

Remove (1): git-1.7.6-1

> pacman -Rs git python
checking dependencies...

Remove (3): git-1.7.6-1 python-3.2.1-1 tk-8.5.10-1

Note that this only affects automatic recursion, optdepends can still manually be removed (see above)

if a flag is given, optdeps are recursively removed even if there is still a package needing them [done]

Suppose tk, python and git are installed. python and git optdepend on tk.

> pacman -Rs --optdeps git
checking dependencies...
:: python: optionally requires tk (for IDLE, pynche and modulator)

Remove (2): git-1.7.6-1 tk-8.5.10-1

Other Ideas

  • A flag/configuration option to install a packages optdepends by default [done]
  • Add option to tell pacman if you want it to ask you about installing each single optdepend [done]
  • Add option to tell pacman to list optdepends even when installed and indicate install status of each [done]