blob: 05fc5d46c92d73d82952fa5e05a1bbf26df012d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/env python3
import sys
import subprocess
pkts = []
for arg in sys.argv[1:]:
proc = subprocess.Popen(["dpkg-deb", "--info", arg], stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out = proc.stdout.read()
err = proc.stderr.read()
if err:
print("An error occurred with {} ({})".format(arg, err))
continue
for line in out.splitlines():
line = line.decode('utf-8')
if " Depends:" in line:
line = line.replace(" Depends:", "")
for _dep in line.split(','):
pkts.append(_dep.split()[0])
print(" ".join(pkts))
|