Skip to content

Add openSUSE support to install.sh#77

Merged
AdmGenSameer merged 2 commits into
mainfrom
copilot/add-opensuse-support
Nov 13, 2025
Merged

Add openSUSE support to install.sh#77
AdmGenSameer merged 2 commits into
mainfrom
copilot/add-opensuse-support

Conversation

Copilot AI commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

Description

The install.sh script failed on openSUSE distributions, defaulting to Fedora and attempting to use dnf which doesn't exist on openSUSE systems.

Related Issue

Fixes #<issue_number>

Changes Made

  • Added openSUSE detection for variants: opensuse, opensuse-tumbleweed, opensuse-leap, suse*
  • Added zypper package manager support (rpm -q for checking, zypper install -y for installing)
  • Removed duplicate install_package() function definition

Distribution Detection (lines 32-35):

opensuse|opensuse-tumbleweed|opensuse-leap|suse*)
    DISTRO="opensuse"
    echo "[*] Treating $ID as openSUSE-based."
    ;;

Package Manager Support (lines 68-70):

opensuse)
    rpm -q "$PACKAGE" &> /dev/null || sudo zypper install -y "$PACKAGE"
    ;;

Screenshots or GIFs (if applicable)

N/A

Checklist

  • Code is formatted with the project's Prettier config provided in .prettierrc (if present).
  • Only the necessary files are modified; no unrelated changes are included.
  • Follows clean code principles (readable, maintainable, minimal duplication).
  • All changes are clearly documented.
  • Code has been tested (manual/automated) and verified against edge cases.
  • No breaking changes are introduced to existing functionality.
  • All new and existing tests passed (if tests exist).

Additional Notes

Net reduction of 16 lines by consolidating duplicate function. All existing distributions (Ubuntu, Fedora, Arch) remain unaffected.

Original prompt

Problem

The install.sh script currently fails on openSUSE Tumbleweed because:

  1. openSUSE distributions are not recognized in the distro detection case statement (lines 19-36)
  2. The script defaults to Fedora and tries to use dnf, which doesn't exist on openSUSE
  3. openSUSE uses zypper as its package manager, which is not supported in the install_package() function

Error Output

[*] Detected Linux distro: openSUSE Tumbleweed (opensuse-tumbleweed)
[!] Unrecognized distro: opensuse-tumbleweed. Defaulting to Fedora (dnf).
[*] Checking and installing system dependencies...
[*] Installing python3 if missing...
sudo: dnf: command not found

Solution

Add support for openSUSE distributions by:

  1. Add openSUSE detection (around lines 19-36): Add a case for openSUSE variants (opensuse, opensuse-tumbleweed, opensuse-leap, etc.) to set DISTRO="opensuse"

  2. Add zypper support to install_package() (in both function definitions at lines 51-69 and 74-92): Add a case for opensuse that uses zypper commands:

    • Check if package is installed: rpm -q "$PACKAGE"
    • Install package: sudo zypper install -y "$PACKAGE"

Expected Behavior

After the fix, the script should:

  • Detect openSUSE distributions correctly
  • Use zypper to install dependencies
  • Successfully complete the installation on openSUSE Tumbleweed and other openSUSE variants

Files to Modify

  • install.sh

This pull request was created as a result of the following prompt from Copilot chat.

Problem

The install.sh script currently fails on openSUSE Tumbleweed because:

  1. openSUSE distributions are not recognized in the distro detection case statement (lines 19-36)
  2. The script defaults to Fedora and tries to use dnf, which doesn't exist on openSUSE
  3. openSUSE uses zypper as its package manager, which is not supported in the install_package() function

Error Output

[*] Detected Linux distro: openSUSE Tumbleweed (opensuse-tumbleweed)
[!] Unrecognized distro: opensuse-tumbleweed. Defaulting to Fedora (dnf).
[*] Checking and installing system dependencies...
[*] Installing python3 if missing...
sudo: dnf: command not found

Solution

Add support for openSUSE distributions by:

  1. Add openSUSE detection (around lines 19-36): Add a case for openSUSE variants (opensuse, opensuse-tumbleweed, opensuse-leap, etc.) to set DISTRO="opensuse"

  2. Add zypper support to install_package() (in both function definitions at lines 51-69 and 74-92): Add a case for opensuse that uses zypper commands:

    • Check if package is installed: rpm -q "$PACKAGE"
    • Install package: sudo zypper install -y "$PACKAGE"

Expected Behavior

After the fix, the script should:

  • Detect openSUSE distributions correctly
  • Use zypper to install dependencies
  • Successfully complete the installation on openSUSE Tumbleweed and other openSUSE variants

Files to Modify

  • install.sh

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: AdmGenSameer <154604600+AdmGenSameer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for openSUSE in install.sh script Add openSUSE support to install.sh Nov 13, 2025
Copilot AI requested a review from AdmGenSameer November 13, 2025 14:48
@AdmGenSameer
AdmGenSameer marked this pull request as ready for review November 13, 2025 14:51
@AdmGenSameer
AdmGenSameer merged commit d1f08ef into main Nov 13, 2025
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants