/usr/bin/catkin_find_pkg is in python-catkin-pkg 0.2.10-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #! /usr/bin/python
"""This script finds a catkin packages"""
from __future__ import print_function
import argparse
import os
import sys
from catkin_pkg.packages import find_packages
def main(argv=sys.argv[1:]):
parser = argparse.ArgumentParser(description='Find a catkin package')
parser.add_argument('pkg', help='The name of the package')
parser.add_argument('base_path', nargs='?', default=os.curdir, help='The base path to crawl for packages')
args = parser.parse_args(argv)
try:
packages = find_packages(args.base_path)
catkin_pkg = [path for path, p in packages.items() if p.name == args.pkg]
if catkin_pkg:
print(catkin_pkg[0])
else:
print("Could not find package '%s'." % args.pkg, file=sys.stderr)
sys.exit(2)
except RuntimeError as e:
print('ERROR: ' + str(e), file=sys.stderr)
sys.exit(1)
if __name__ == '__main__':
main()
|