Skip to content

Commit 37b50c3

Browse files
committed
shellcheck and rhel fixes
1 parent 9e59223 commit 37b50c3

3 files changed

Lines changed: 21 additions & 40 deletions

File tree

.github/workflows/commit_test.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,22 @@ jobs:
5555
needs: shellcheck
5656
runs-on: ubuntu-latest
5757
container:
58-
image: redhat/ubi10:latest # Targeted version for Delphi 13
58+
image: redhat/ubi10:latest
5959
steps:
6060
- name: Checkout Code
6161
uses: actions/checkout@v4
6262

63-
- name: Install Basic Dependencies
64-
# UBI images are minimal; need sudo and procps for pgrep
65-
run: dnf install -y sudo procps-ng
63+
- name: Prepare UBI Environment
64+
# UBI requires manual installation of basic tools usually found in full distros
65+
run: |
66+
dnf install -y sudo procps-ng ncurses-devel tar
6667
6768
- name: Make Script Executable
6869
run: chmod +x ./scripts/SetupLinux4Delphi.sh
6970

7071
- name: Run Setup Script
71-
# RHEL uses dnf/yum logic in your script
72-
run: ./scripts/SetupLinux4Delphi.sh 13.0
73-
74-
- name: Verify Installation Files
75-
run: |
76-
if [ -x "/usr/local/bin/pa13.0.sh" ]; then
77-
echo "✅ PAServer launch script found."
78-
else
79-
echo "❌ PAServer launch script missing."
80-
exit 1
81-
fi
72+
# We pass "13.0" and force "dnf" to bypass registration checks
73+
run: ./scripts/SetupLinux4Delphi.sh 13.0 dnf
8274

8375
- name: Test PAServer Execution
8476
run: |

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Linux4Delphi Setup
22

3-
[![ShellCheck Status](https://github.com/OWNER/REPOSITORY/actions/workflows/commit_test.yml/badge.svg?label=ShellCheck)](https://github.com/OWNER/REPOSITORY/actions/workflows/commit_test.yml)
4-
[![Ubuntu 24.04 Status](https://github.com/OWNER/REPOSITORY/actions/workflows/commit_test.yml/badge.svg?label=Ubuntu%2024.04)](https://github.com/OWNER/REPOSITORY/actions/workflows/commit_test.yml)
5-
[![RHEL 10 Status](https://github.com/OWNER/REPOSITORY/actions/workflows/commit_test.yml/badge.svg?label=RHEL%2010)](https://github.com/OWNER/REPOSITORY/actions/workflows/commit_test.yml)
3+
[![ShellCheck Status](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml/badge.svg?label=ShellCheck)](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml)
4+
[![Ubuntu 24.04 Status](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml/badge.svg?label=Ubuntu%2024.04)](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml)
5+
[![RHEL 10 Status](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml/badge.svg?label=RHEL%2010)](https://github.com/jimmckeeth/linux4delphi/actions/workflows/commit_test.yml)
66

77

88
![ShellCheck](https://img.shields.io/github/actions/workflow/status/OWNER/REPOSITORY/commit_test.yml?job=shellcheck&label=ShellCheck&logo=shell)

scripts/SetupLinux4Delphi.sh

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -304,32 +304,25 @@ if [[ "$PKG" == "apt" ]]; then
304304
echo "No suitable ncurses package found."
305305
exit 1
306306
fi
307-
set +e
308-
apt install openssh-server -y --no-install-recommends
309-
if [ $? -ne 0 ]; then
307+
if ! apt install openssh-server -y --no-install-recommends; then
310308
echo "Warning: openssh-server installation failed, removing..."
311309
apt purge openssh-server -y
312310
fi
313-
set -e
314311
# Removed libosmesa-dev from strict requirements
315312
apt install joe wget p7zip-full curl build-essential zlib1g-dev libcurl4-gnutls-dev python3 libpython3-dev libgtk-3-dev $NCURSES_PKG xorg libgl1-mesa-dev libgtk-3-bin libc6-dev -y --no-install-recommends
316313
# Optional installation of OSMesa (handles missing package errors gracefully)
317314
echo "Attempting to install optional libosmesa-dev..."
318-
set +e
319-
apt install libosmesa-dev -y --no-install-recommends 2>/dev/null
320-
if [ $? -ne 0 ]; then
315+
if apt install libosmesa-dev -y --no-install-recommends 2>/dev/null; then
316+
osmesa="Installed optional libosmesa-dev successfully."
317+
else
321318
echo "libosmesa-dev not found, checking for libosmesa6-dev..."
322-
apt install libosmesa6-dev -y --no-install-recommends 2>/dev/null
323-
if [ $? -ne 0 ]; then
324-
osmesa="Warning: Optional package libosmesa-dev (or libosmesa6-dev) was not found. Continuing installation without it."
325-
else
319+
if apt install libosmesa6-dev -y --no-install-recommends 2>/dev/null; then
326320
osmesa="Installed optional libosmesa6-dev successfully."
321+
else
322+
osmesa="Warning: Optional package libosmesa-dev (or libosmesa6-dev) was not found. Continuing installation without it."
327323
fi
328-
else
329-
osmesa="Installed optional libosmesa-dev successfully."
330324
fi
331325
echo "$osmesa"
332-
set -e
333326
elif [[ "$PKG" == "pacman" ]]; then
334327
# SteamOS has a read-only filesystem, this command disables that.
335328
if command -v steamos-readonly &> /dev/null; then
@@ -355,7 +348,7 @@ elif [[ "$PKG" == "pacman" ]]; then
355348
fi
356349
else
357350
if [[ "$PKG" == "dnf" ]]; then
358-
if [[ ("$ID_LIKE" == *"fedora"* || "$ID" == "fedora") && "${VERSION_ID}" -ge 40 ]]; then
351+
if [[ ("$ID_LIKE" == *"fedora"* || "$ID" == "fedora") && "${VERSION_ID%%.*}" -ge 40 ]]; then
359352
dnf group install c-development development-tools --setopt=install_weak_deps=False -y
360353
else
361354
dnf groupinstall 'Development Tools' --setopt=install_weak_deps=False -y
@@ -365,10 +358,6 @@ else
365358
fi
366359
$PKG install wget gtk3 mesa-libGL gtk3-devel python3 zlib-devel python3-devel --setopt=install_weak_deps=False -y
367360
fi
368-
if [ $? -ne 0 ]; then
369-
echo "Package installation failed. Aborting."
370-
exit 1
371-
fi
372361

373362
echo "__________________________________________________________________"
374363
echo ""
@@ -405,11 +394,11 @@ fi
405394
if [[ "$PRODUCT" == "11.2" ]]; then
406395
echo "Fixing lldb Python dependency"
407396
if [[ "$PKG" == "apt" ]]; then
408-
ln -sf "$(ls -1 /usr/lib/x86_64-linux-gnu/libpython3.*.so.1.0 | tail -1)" "$INSTALL_DIR"/lldb/lib/libpython3.so
397+
ln -sf "$(find /usr/lib/x86_64-linux-gnu -maxdepth 1 -name "libpython3.*.so.1.0" | sort | tail -1)" "$INSTALL_DIR"/lldb/lib/libpython3.so
409398
elif [[ "$PKG" == "pacman" ]]; then
410-
ln -sf "$(ls -1 /usr/lib/libpython3.*.so | tail -1)" "$INSTALL_DIR"/lldb/lib/libpython3.so
399+
ln -sf "$(find /usr/lib -maxdepth 1 -name "libpython3.*.so" | sort | tail -1)" "$INSTALL_DIR"/lldb/lib/libpython3.so
411400
else
412-
ln -sf "$(ls -1 /usr/lib64/libpython3*.so.1.0 | tail -1)" "$INSTALL_DIR"/lldb/lib/libpython3.so
401+
ln -sf "$(find /usr/lib64 -maxdepth 1 -name "libpython3*.so.1.0" | sort | tail -1)" "$INSTALL_DIR"/lldb/lib/libpython3.so
413402
fi
414403
fi
415404
# Ensure ownership by the invoking user

0 commit comments

Comments
 (0)