aboutsummaryrefslogtreecommitdiff
path: root/tools/cpm/which.sh
blob: 11d9b841568ab76c10f3fb63d4c5aa105da9e103 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh -e

# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later

# check which file a package is in
# shellcheck disable=SC1091
. tools/cpm/common.sh

# shellcheck disable=SC2086
JSON=$(echo "$CPMFILES" | xargs grep -l "$1")

[ -z "$JSON" ] && echo "!! No cpmfile definition for $1" >&2 && exit 1

echo "$JSON"