Skip to content

Commit

Permalink
Merge pull request #123 from Al3cr1s/master
Browse files Browse the repository at this point in the history
Fix install script
  • Loading branch information
il-palmi authored Oct 17, 2024
2 parents 252261e + 7208510 commit f0613a3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
37 changes: 19 additions & 18 deletions INSTALL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ echo "This script will install PESTO on your system, would you like to proceed?
echo " "
tput sgr0

read CONFIRM
read -r CONFIRM

if [[ "$CONFIRM" != 'y' && "$CONFIRM" != 'Y' && "$CONFIRM" = "" ]]; then
tput setab $RED
Expand All @@ -31,20 +31,20 @@ fi

echo "Moving files in working directories ..."

sudo cp -r $CURRENT_DIR /opt/
sudo cp -r "$CURRENT_DIR" /opt/

sudo cp /opt/$FOLDER_NAME/desktop_files/basilico.desktop /usr/share/applications/
sudo cp /opt/$FOLDER_NAME/desktop_files/pinolo.desktop /usr/share/applications/
sudo cp /opt/$FOLDER_NAME/desktop_files/uninstall_pinolo.desktop /usr/share/applications/
sudo cp /opt/$FOLDER_NAME/basilico.service /etc/systemd/system/
sudo cp "/opt/$FOLDER_NAME/desktop_files/basilico.desktop" /usr/share/applications/
sudo cp "/opt/$FOLDER_NAME/desktop_files/pinolo.desktop" /usr/share/applications/
sudo cp "/opt/$FOLDER_NAME/desktop_files/uninstall_pinolo.desktop" /usr/share/applications/
sudo cp "/opt/$FOLDER_NAME/basilico.service" /etc/systemd/system/

echo "Generating python virtual environment ..."

PYTHON_VERSION=$(python3 -c 'import sys; print(sys.version_info[1])')
if [[ "$PYTHON_VERSION" -ge 10 ]]; then
sudo python3 -m venv /opt/$FOLDER_NAME/venv
sudo python3 -m venv "/opt/$FOLDER_NAME/venv"
elif [[ "$(which python3.10)" != "" ]]; then
sudo python3.10 -m venv /opt/$FOLDER_NAME/venv
sudo python3.10 -m venv "/opt/$FOLDER_NAME/venv"
else
tput setab $RED
tput setaf $BLACK
Expand All @@ -55,18 +55,19 @@ else
tput sgr0
exit 1
fi
sudo chown -R $USERNAME:$USERNAME /opt/pesto
source /opt/$FOLDER_NAME/venv/bin/activate
pip install -r /opt/$FOLDER_NAME/requirements_client.txt
pip install -r /opt/$FOLDER_NAME/requirements_server.txt

sudo chown -R "$USERNAME:$USERNAME" "/opt/$FOLDER_NAME"
source "/opt/$FOLDER_NAME/venv/bin/activate"
pip install -r "/opt/$FOLDER_NAME/requirements_client.txt"
pip install -r "/opt/$FOLDER_NAME/requirements_server.txt"
deactivate

echo "Installing system dependencies"
if [[ "$(where apt)" != "" ]]; then
if [[ "$(which apt)" != "" ]]; then
sudo apt update
sudo apt install cloud-utils smartmontools
elif [["$(where pacman)" != "" ]]; then
sudo pacman -Sy cloud-utils smartmontools
sudo apt install -y cloud-utils smartmontools
elif [[ "$(which pacman)" != "" ]]; then
sudo pacman -Sy --noconfirm cloud-utils smartmontools
else
tput setab $RED
tput setaf $BLACK
Expand All @@ -82,6 +83,6 @@ sudo systemctl daemon-reload
tput setaf $BLACK
tput setab $GREEN
echo " "
echo "Installation completed succsessfully! Search for PINOLO in your applications launcher."
echo "Installation completed successfully! Search for PINOLO in your applications launcher."
echo " "
tput sgr0
tput sgr0
2 changes: 1 addition & 1 deletion basilico.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def cannolo(self, _cmd: str, dev_and_iso: str):
else:
success = self.dd(iso, dev)
if success:
success = run_command_on_partition(dev, f"sudo growpart {dev} 1")
success = run_command_on_partition(dev, f"sudo growpart {dev} 1") #FIXME: se ha più partizioni non funziona
if success:
success = run_command_on_partition(dev, f"sudo e2fsck -fy {dev}1")
if success:
Expand Down
9 changes: 4 additions & 5 deletions requirements_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ charset-normalizer==2.1.0
constantly==15.1.0
hyperlink==21.0.0
idna==3.7
playsound==1.3.0
PyQt5==5.15.7
PyQt5-Qt5==5.15.2
PyQt5-sip==12.11.0
PyQt5==5.15.11
PyQt5-Qt5==5.15.15
PyQt5-sip==12.15.0
pytarallo==2.4.0
python-dotenv==0.20.0
requests==2.32.0
six==1.16.0
Twisted==24.7.0
typing_extensions==4.3.0
urllib3==1.26.19
zope.interface==5.4.0
zope.interface==5.4.0

0 comments on commit f0613a3

Please sign in to comment.