• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

img/H03-May-2022-

portgraph/H03-May-2022-214184

portgraph.egg-info/H03-May-2022-14093

MANIFEST.inH A D16-Feb-201847 32

PKG-INFOH A D17-Feb-20185.1 KiB14093

README.mdH A D16-Feb-20184 KiB10257

setup.cfgH A D17-Feb-201838 53

setup.pyH A D17-Feb-20181.1 KiB3734

README.md

1Started from an idea on twitter and used to reduce the dependencies of a port, here a python script to produce dependencies' graph of a(ll) FreeBSD ports.
2
3# Install
4## Using pip
5
6`pip install portgraph`
7
8## Using FreeBSD pkg
9
10`pkg install py36-portgraph`
11
12## Using FreeBSD ports
13
14`make -C /usr/ports/ports-mgmt/py-portgraph`
15
16# Usage
17portgraph produces a graph representing the dependencies needed for a given port or all ports.
18
19Options are:
20```
21-h or --help: Show this help
22-l my_dir or --localbase my_dir: Sets my_dir as the directory where ports are located (/usr/ports by default)
23-p my_port or --port my_port: Sets my_port as the port to produce the graph (ports-mgmt/py-portgraph by default).
24-b or --build: build-depends-list (if -b or -r is not present, -b is actived by default).
25-r or --run: run-depends-list (if -b or -r is not present, -b is actived by default).
26-f my_flavor or --flavor my_flavor: Sets the flavor for the port.
27-c or --recursion: Sets the maximum recursion.
28-u or --url: Adds a link to freshports.
29-w or --with-pkg: Since pkg is always required, this is disabled  by default. You can enable it with this option.
30-a or --all: Build a graph for each port
31-v or --verbose: Print the port being traversed
32```
33
34The result is a svg and a graphviz file.
35
36# Examples
37
38## Without arguments:
39
40`portgraph`
41
42[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/py-portgraph.png" alt="without arguments"/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/py-portgraph.svg)
43
44## Using a specific local ports, like poudriere:
45
46`portgraph -l /usr/local/poudriere/ports/default`
47
48
49## Most important arguments, the port:
50
51`portgraph -p ports-mgmt/portscout`
52
53[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/portscout.png" alt="portscout"/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/portscout.svg)
54
55## Sets the flavor for the port:
56
57`portgraph -p databases/py-psycopg2 -f py36`
58
59[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/py-psycopg2@py36.png" alt="py36-psycopg2"/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/py-psycopg2@py36.svg)
60
61`portgraph -p databases/py-psycopg2 -f py27`
62
63[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/py-psycopg2@py27.png" alt="py27-psycopg2"/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/py-psycopg2@py27.svg)
64
65## You can define the depth of the dependencies to display
66
67`portgraph -p databases/pgmodeler -c 1`
68
69[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/pgmodeler_rec_1.png" alt="pgmodeler with max recursion defined" width="20%" height="20%"/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/pgmodeler_rec_1.svg)
70
71## You want a link to freshports? Add the -u/--url option.
72
73`portgraph -p databases/sfcgal -u -c 2`
74
75[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/sfcgal.png" alt="sfcgal with freshports url" width="20%" height="20%"/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/sfcgal.svg)
76
77## ports-mgmt/pkg is the god of all. Do you want to put it?
78
79`portgraph -p ports-mgmt/portscout -w`
80
81[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/portscout_pkg.png" alt="portscout with pkg"/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/portscout_pkg.svg)
82
83## Run and build depends list
84
85build-depends-list are blue and run-depends-list are red.
86
87`portgraph -p lang/python36 -rb -c 2 -u`
88
89[<img src="https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/python36.png" alt="python36 with run-depends-list, build-depends-list, url and max recursion defined "/>](https://glcdn.githack.com/lbartoletti/portgraph/raw/master/img/python36.svg)
90
91
92## Build all ports (accept all arguments except -p/--ports)
93
94For freshports with only one dependency.
95
96`portgraph -a -c 1 -u`
97
98
99It can take a long time (880s on my desktop computer and produces 245M of files).
100
101> Note: examples were made on 2018-02-15. The results may differ depending on port updates.
102