File: cscope.sh

package info (click to toggle)
drgn 0.0.33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,892 kB
  • sloc: python: 59,081; ansic: 51,400; awk: 423; makefile: 339; sh: 113
file content (17 lines) | stat: -rwxr-xr-x 644 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# SPDX-License-Identifier: LGPL-2.1-or-later

: ${PYTHON:=python3}
cscope_args=(-bq -i-)

python_include="$("$PYTHON" -c 'import sysconfig; print(sysconfig.get_path("include"))' 2>/dev/null)"
if [[ -n $python_include ]] ; then
	cscope_args+=("-I$python_include")
fi
python_platinclude="$("$PYTHON" -c 'import sysconfig; print(sysconfig.get_path("platinclude"))' 2>/dev/null)"
if [[ -n $python_platinclude && $python_platinclude != $python_include ]] ; then
	cscope_args+=("-I$python_platinclude")
fi

find libdrgn -name '*.[ch]' -o -name '*.[ch].in' | cscope "${cscope_args[@]}"