drgn/scripts/cscope.sh
Omar Sandoval 4031093848 Add some missing copyright/license notices
I wanted to make REUSE pass, but I'm not sure what to do about trivial
files. REUSE suggests using CC0, but Fedora no longer allows CC0. I'll
punt that until later. For now, let's add notices to some code files.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-11-01 17:14:02 -07:00

18 lines
644 B
Bash
Executable File

#!/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[@]}"