Skip to content

Commit

Permalink
fix: give more feedback if the installation fails (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke authored Jan 21, 2025
1 parent 3eec1eb commit e1cd266
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit e1cd266

Please sign in to comment.