Ticket #191: setupt.py

File setupt.py, 933 bytes (added by Silvan Scherrer, 8 years ago)
Line 
1#! /@unixroot/usr/bin/python
2
3
4import os
5import re
6import subprocess
7import sys
8import platform
9
10package = 'poppler-qt4'
11cmd = ['pkg-config']
12cmd += ['--cflags', '--libs']
13cmd.append(package)
14sys.stderr.write("bww trace executed cmd: %s\n" % cmd)
15try:
16 output = subprocess.check_output(cmd)
17 sys.stderr.write("bww trace output1: %s\n" % output)
18 output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
19 sys.stderr.write("bww trace output2: %s\n" % output)
20except OSError:
21 sys.stderr.write("Can't determine package of %s\n" % package)
22
23cmd = ['pkg-config', '--modversion', package]
24try:
25 output = subprocess.check_output(cmd)
26 sys.stderr.write("bww trace output3: %s\n" % output)
27 output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
28 sys.stderr.write("bww trace output4: %s\n" % output)
29except OSError:
30 sys.stderr.write("Can't determine version of %s\n" % package)
31