diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-07-28 13:05:54 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2023-07-28 14:10:31 -0300 |
commit | 200f389ed0f56ba42160fe135e3701757a8df94c (patch) | |
tree | 644ebe2eccff1991e11ff1f6391df0f60e9978f1 /platform/rpm | |
parent | build: fix shellcheck issues in mkrpm.sh/compile.sh (diff) | |
download | firejail-200f389ed0f56ba42160fe135e3701757a8df94c.tar.gz firejail-200f389ed0f56ba42160fe135e3701757a8df94c.tar.zst firejail-200f389ed0f56ba42160fe135e3701757a8df94c.zip |
build: use config.sh in more scripts
This removes the need to manually pass variables such as `$(TARNAME)`
and `$(VERSION)` to shell scripts in the root Makefile.
Relates to #5140.
Diffstat (limited to 'platform/rpm')
-rwxr-xr-x | platform/rpm/mkrpm.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/rpm/mkrpm.sh b/platform/rpm/mkrpm.sh index de26ca8d1..0572480c6 100755 --- a/platform/rpm/mkrpm.sh +++ b/platform/rpm/mkrpm.sh | |||
@@ -3,15 +3,18 @@ | |||
3 | # Copyright (C) 2014-2023 Firejail Authors | 3 | # Copyright (C) 2014-2023 Firejail Authors |
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | # | 5 | # |
6 | # Usage: ./platform/rpm/mkrpm.sh firejail <version> "<config options>" | 6 | # Usage: ./platform/rpm/mkrpm.sh <config options> |
7 | # | 7 | # |
8 | # Builds rpms in a temporary directory then places the result in the | 8 | # Builds rpms in a temporary directory then places the result in the |
9 | # current working directory. | 9 | # current working directory. |
10 | 10 | ||
11 | name="$1" | 11 | # shellcheck source=config.sh |
12 | . "$(dirname "$0")/../../config.sh" || exit 1 | ||
13 | |||
14 | name="$TARNAME" | ||
12 | # Strip any trailing prefix from the version like -rc1 etc | 15 | # Strip any trailing prefix from the version like -rc1 etc |
13 | version="$(printf '%s\n' "$2" | sed 's/\-.*//g')" | 16 | version="$(printf '%s\n' "$VERSION" | sed 's/\-.*//g')" |
14 | config_opt="$3" | 17 | config_opt="$*" |
15 | 18 | ||
16 | if [[ ! -f "platform/rpm/${name}.spec" ]]; then | 19 | if [[ ! -f "platform/rpm/${name}.spec" ]]; then |
17 | printf 'error: spec file not found for name %s\n' "${name}" >&2 | 20 | printf 'error: spec file not found for name %s\n' "${name}" >&2 |