Repository navigation
install.sh: support RPM-based Linux distributions (Fedora, RHEL, openSUSE) - #153
Open
proxy-turkey wants to merge 1 commit into
Open
proxy-turkey wants to merge 1 commit into
proxy-turkey wants to merge 1 commit into
Conversation
Fedora, RHEL, and openSUSE users currently get a hard stop because the installer only knows apt-get. The Linux release is a .deb, so the installer now detects the package-manager family and, on rpm-based systems: - prefers a native CommandCode-<version>-x86_64.rpm as soon as a release publishes one (no further changes needed when that happens), - otherwise downloads the .deb and verifies its SHA-256 digest exactly as on Debian/Ubuntu, then repacks the verified payload into a local RPM with rpmbuild and installs it through dnf or zypper, keeping the package tracked and removable by the package manager, - falls back to installing the payload directly with the same file layout, launcher, and desktop entry when rpmbuild is not available, printing the exact paths to remove on uninstall, - sets the SUID bit on chrome-sandbox (same as the deb postinst fallback), refreshes desktop/icon caches, and relabels files on SELinux systems. Payload sanity checks mirror the macOS installer (executable, desktop entry, compiled engine) and everything runs only after SHA-256 verification. The apt and macOS paths are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Linux releases ship a
.debonly, andinstall.shhard-requiresapt-get, so the one-command installer stops with "This preview currently supports Debian and Ubuntu through a .deb package" on Fedora, RHEL, and openSUSE. The README platform table reflects the same gap.What this changes
install.shnow detects the Linux package-manager family (apt-get→ apt,dnf/zypper/yum→ rpm) and on rpm-based systems:.rpm— the asset search first triesCommandCode-<version>-x86_64.rpmand falls back to the.deb. The moment a release publishes a native rpm, the installer picks it up with no further changes..deblocally when no rpm exists: download → SHA-256 verification (unchanged, happens before anything touches the system) → unpack withar(orbsdtar) → payload sanity checks mirroring the macOS installer (executable, desktop entry, compiled engine) → build a local RPM withrpmbuild→ install viadnf/zypper(with areinstallfallback so re-running the installer on the same version stays idempotent, matching the "run again to update" promise).rpmbuildis not installed — same file layout,/usr/bin/command-codelauncher, desktop entry, icons — and prints the exact paths to remove.postinstbehavior: SUID onchrome-sandbox, desktop/icon cache refresh, plus SELinux relabel viarestoreconwhere available.The generated RPM disables the automatic dependency generator because the payload bundles optional native modules for other platforms (arm64/musl/win32/darwin) that would produce unresolvable requires; runtime dependencies are declared explicitly (gtk3, nss, libnotify, libsecret, alsa-lib, …).
Docs: README install sentence and platform table note, plus a new "RPM-based Linux" section in INSTALL.md describing the flow and uninstall (
sudo dnf remove command-code).The apt and macOS paths are unchanged (apt detection now happens before download instead of at install time, with an equivalent failure message).
Testing
On Fedora 43 x86_64 against v0.1.60:
COMMANDCODE_INSTALL_DRY_RUN=1resolvesCommandCode-0.1.60-amd64.debon a dnf system (no rpm asset exists yet).dnftracks the package,chrome-sandboxis SUID, desktop entry and icons installed.rpmbuildremoved from PATH: direct-install fallback works and prints removal paths.bash -nclean; zypper path follows the same code shape as dnf but could only be reviewed, not run.Notes for maintainers
CommandCode-<version>-x86_64.rpm, so publishing that asset is the only remaining step..AppImagethat is not listed in the README table; this PR deliberately does not touch it, but it might deserve a docs mention (or the repack path here, which avoids the libfuse2 dependency, may be preferable anyway). Happy to adjust or split commits.