Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: give more feedback if the installation fails #167

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fact_extractor/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
from helperFunctions.install import OperateInDirectory
from install.common import main as common
from install.unpacker import main as unpacker
except ImportError:
sys.exit('Could not import install dependencies. Please (re-)run install/pre_install.sh')
except (ImportError, ModuleNotFoundError) as error:
logging.error(f'Could not import install dependencies. Please (re-)run install/pre_install.sh. Error: {error}')
sys.exit(1)

PROGRAM_NAME = 'FACT_extractor Installer'
PROGRAM_VERSION = __VERSION__
Expand Down
9 changes: 5 additions & 4 deletions fact_extractor/install/pre_install.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/usr/bin/env bash
set -euxo pipefail

echo "Install Pre-Install Requirements"
(apt-get update && apt-get install sudo) || true
(apt-get update && apt-get install -y sudo) || true

sudo apt-get update
sudo apt-get -y install git apt-transport-https ca-certificates curl software-properties-common wget libmagic-dev xz-utils
sudo apt-get install -y git apt-transport-https ca-certificates curl software-properties-common wget libmagic-dev xz-utils

IS_VENV=$(python3 -c 'import sys; print(sys.exec_prefix!=sys.base_prefix)')
if [[ $IS_VENV == "False" ]]
then
SUDO="sudo -EH"
sudo apt-get -y install python3-pip python3-wheel python3-setuptools
sudo apt-get install -y python3-pip python3-wheel python3-setuptools
else
SUDO=""
fi

$SUDO pip3 install --upgrade pip setuptools wheel
$SUDO pip3 install --upgrade pip setuptools wheel "packaging>=22"
$SUDO pip3 install --upgrade distro
$SUDO pip3 install --upgrade git+https://github.com/fkie-cad/common_helper_files.git
$SUDO pip3 install --upgrade git+https://github.com/fkie-cad/common_helper_process.git
Expand Down
Loading