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

From ArchWiki
Jump to: navigation, search
m (Other Ideas)
Line 18: Line 18:
 
  > pacman -Qi tk
 
  > pacman -Qi tk
 
  Required By: python (optional)
 
  Required By: python (optional)
 +
 +
'''information about optdepends is not output if an optdepends package is installed'''
 +
> pacman -S tk
 +
> pacman -S python
 +
(no optional dependencies notification output)
  
 
'''optdepends are not orphans unless a flag is specified'''
 
'''optdepends are not orphans unless a flag is specified'''
Line 28: Line 33:
 
  Remove (2): python-2.6.1-1  tk-8.5.6-1
 
  Remove (2): python-2.6.1-1  tk-8.5.6-1
  
'''information about optdepends is not output if an optdepends package is installed'''
+
'''packages which are only optrequired get a nonfatal warning'''
  > pacman -S tk
+
> pacman -R tk
  > pacman -S python
+
checking dependencies...
  (no optional dependencies notification output)
+
:: python: optionally requires tk: for IDLE, pynche and modulator
 +
 +
Remove (1): tk-8.5.10-1
 +
 
 +
'''optdeps are not recursively removed if there is still a package needing them'''
 +
 
 +
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)
  
 +
'''cascading only affects optrequires if a flag is given'''
 +
> pacman -Rc tk
 +
checking dependencies...
 +
 +
Remove (1): tk-8.5.10-1
 +
 +
> pacman -Rc --optdepends tk
 +
checking dependencies...
 +
 +
Remove (2): tk-8.5.10-1 python-3.2.1-1
 +
 
====Other Ideas====
 
====Other Ideas====
 
* A flag/configuration option to install a packages optdepends by default
 
* A flag/configuration option to install a packages optdepends by default
 
* Add option to tell pacman if you want it to ask you about installing each single optdepend
 
* Add option to tell pacman if you want it to ask you about installing each single optdepend
 
* Add option to tell pacman to list optdepends even when installed and indicate install status of each
 
* Add option to tell pacman to list optdepends even when installed and indicate install status of each

Revision as of 16:58, 1 August 2011

The Idea

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

How to improve?

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

pacman recognises installed optdepends

> 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

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

optdepends are not orphans unless a flag is specified

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

optdepends can be removed with -Rs

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

packages which are only optrequired get a nonfatal warning

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

Remove (1): tk-8.5.10-1

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

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)

cascading only affects optrequires if a flag is given

> pacman -Rc tk
checking dependencies...

Remove (1): tk-8.5.10-1

> pacman -Rc --optdepends tk
checking dependencies...

Remove (2): tk-8.5.10-1 python-3.2.1-1

Other Ideas

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