1
0
Fork 0

refresh-requirements: Verify that script dependencies are installed

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
spacecruft
Vasilis Tsiligiannis 2022-04-29 19:18:40 +03:00
parent a4d6601fb1
commit 6eda3ca996
1 changed files with 23 additions and 1 deletions

View File

@ -2,7 +2,7 @@
# #
# Script to refresh requirements.txt file # Script to refresh requirements.txt file
# #
# Copyright (C) 2019-2021 Libre Space Foundation <https://libre.space/> # Copyright (C) 2019-2022 Libre Space Foundation <https://libre.space/>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -21,6 +21,28 @@ EXCLUDE_REGEXP="^\\(pkg[-_]resources\\|satnogs-db\\)"
COMPATIBLE_REGEXP="^\\(satnogs-decoders\\)" COMPATIBLE_REGEXP="^\\(satnogs-decoders\\)"
VIRTUALENV_DIR=$(mktemp -d) VIRTUALENV_DIR=$(mktemp -d)
PIP_COMMAND="$VIRTUALENV_DIR/bin/pip" PIP_COMMAND="$VIRTUALENV_DIR/bin/pip"
REQUIREMENTS="
comm
grep
sed
sort
virtualenv
"
# Check for required utilities
for req in $REQUIREMENTS; do
if ! which "$req" >/dev/null; then
if [ -z "$has_missing" ]; then
echo "$(basename "$0"): Missing script requirements!" 1>&2
echo "Please install:" 1>&2
has_missing=1
fi
echo " - '$req'" 1>&2
fi
done
if [ -n "$has_missing" ]; then
exit 1
fi
# Create virtualenv # Create virtualenv
virtualenv "$VIRTUALENV_DIR" virtualenv "$VIRTUALENV_DIR"