5 import xml.etree.ElementTree
as ET
9 if pkg
in rospack.list()
or pkg
in rosstack.list():
11 os.chdir(rospack.get_path(pkg))
13 os.chdir(rosstack.get_path(pkg))
16 if (subprocess.call([
'git',
'branch'], stderr=subprocess.STDOUT, stdout=open(os.devnull,
'w')) == 0):
17 proc = subprocess.Popen([
'git',
'describe',
'--tags'], stdout=subprocess.PIPE, stderr=open(os.devnull,
'w'))
19 proc = subprocess.Popen([
'rosversion', pkg], stdout=subprocess.PIPE)
20 version = proc.communicate()[0].rstrip()
22 if (version ==
'<unversioned>' and os.path.isfile(
'package.xml')):
23 tree = ET.parse(
'package.xml').getroot()
24 version = tree.find(
'version').text
25 print(
"(%s) - %s" % (pkg, version))
27 print(
"(%s) - Not found." % pkg)
40 if __name__ ==
'__main__':
42 rospack = rospkg.RosPack()
43 rosstack = rospkg.RosStack()
45 from joblib
import Parallel, delayed
46 Parallel(n_jobs=-1)(delayed(versionSupport)(pkg)
for pkg
in pkgs)