subuser-security/subuser — pull request #74 by peter1000 (2014-02-19 15:22:12+00:00)
Title: * Added: new command 'print-dependency-matrix' 

Which can take similar to 'list' the arguments: available, installed or a list of subuser-programs

e.g. Multi name input

```
workerm@notebook:~$ subuser print-dependency-matrix firefox vim

===== DEPENDENCY MATRIX =====

:
required-by: []
depends-on: ['firefox', u'libx11']
:
required-by: []
depends-on: ['vim']
workerm@notebook:~$

```

e.g. option:installed
```
subuser print-dependency-matrix installed

===== DEPENDENCY MATRIX =====

:
required-by: [u'firefox']
depends-on: [u'libx11']
:
required-by: []
depends-on: [u'firefox', u'libx11']
:
required-by: []
depends-on: [u'vim']
workerm@notebook:~$
```

e.g. Option: available
```
subuser print-dependency-matrix available

===== DEPENDENCY MATRIX =====

:
required-by: []
depends-on: [u'firefox', 'firefox-java', u'libx11']
:
required-by: ['emacs', 'firefox', 'firefox-flash', 'firefox-java', 'libreoffice', 'skype', 'xterm']
depends-on: ['libx11']
:
required-by: ['firefox-flash', 'firefox-java']
depends-on: ['firefox', u'libx11']
:
required-by: []
depends-on: [u'firefox', 'firefox-flash', u'libx11']
:
required-by: []
depends-on: [u'libx11', 'xterm']
:
required-by: []
depends-on: ['irssi']
:
required-by: []
depends-on: ['vim']
:
required-by: []
depends-on: ['git']
:
required-by: []
depends-on: ['emacs', u'libx11']
:
required-by: []
depends-on: [u'libx11', 'skype']
:
required-by: []
depends-on: ['libreoffice', u'libx11']
workerm@notebook:~$
```

The main function: getDependencyMatrix has some extras like: sorting useHasExecutable

e.g. with useHasExecutable: (this is not implemented in the command 'print-dependency-matrix')

```
===== DEPENDENCY MATRIX =====

:
required-by: []
depends-on: [u'firefox', 'firefox-java', u'libx11']
has-executable: True
:
required-by: ['emacs', 'firefox', 'firefox-flash', 'firefox-java', 'libreoffice', 'skype', 'xterm']
depends-on: ['libx11']
has-executable: False
:
required-by: ['firefox-flash', 'firefox-java']
depends-on: ['firefox', u'libx11']
has-executable: True
:
required-by: []
depends-on: [u'firefox', 'firefox-flash', u'libx11']
has-executable: True
:
required-by: []
depends-on: [u'libx11', 'xterm']
has-executable: True
:
required-by: []
depends-on: ['irssi']
has-executable: True
:
required-by: []
depends-on: ['vim']
has-executable: True
:
required-by: []
depends-on: ['git']
has-executable: True
:
required-by: []
depends-on: ['emacs', u'libx11']
has-executable: True
:
required-by: []
depends-on: [u'libx11', 'skype']
has-executable: True
:
required-by: []
depends-on: ['libreoffice', u'libx11']
has-executable: True
workerm@notebook:~$
```

Also if one has by mistake defined a wrong dependency in the permission.json it raises an error -quite useful I think best used `subuser print-dependency-matrix available` I manually introduced an error and the output is

```
subuser print-dependency-matrix available
ERROR: [Errno 2] No such file or directory: u'/home/workerm/subuser/programsThatCanBeInstalled/firefox-not-here/permissions.json'

Suggestion: maybe it is defined as a wrong dependency in a permission.json file

workerm@notebook:~$

```

I know this could be more specific buy it is only a side effect and not a feature (at the moment)