FIxes #3043 Added Non Interactive Install script - #3063
Conversation
|
/claude review |
| # Execute the installer | ||
| printf "%bRunning installer...%b\n" "$GREEN" "$NC" | ||
| ./installer | ||
| ./installer "$@" |
There was a problem hiding this comment.
Forwarding args makes a non-zero installer exit a routine outcome (missing --yes, bad --compositor/--privesc value, unknown --git-deps name). With set -e at the top of the script, that aborts here and the cleanup on lines 85-86 never runs, so the ~15MB extracted installer and its temp dir are left behind in /tmp on every failed headless invocation. Previously the piped script always ran the TUI, which exits 0.
A trap right after TEMP_DIR is created makes cleanup unconditional and preserves the installer's exit code:
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "$TEMP_DIR"' EXIT| markGit := func(dep *deps.Dependency) { | ||
| if dep.Variant == deps.VariantStable && dep.Status == deps.StatusInstalled { | ||
| reinstallItems[dep.Name] = true | ||
| } | ||
| dep.Variant = deps.VariantGit | ||
| } |
There was a problem hiding this comment.
CanToggle is not equivalent to "has a git variant", so this gates on the wrong thing. hyprland is created with CanToggle: true for every distro (distros/base.go:314), but Arch's mapping explicitly discards the variant:
func (a *ArchDistribution) getHyprlandMapping(_ deps.PackageVariant) PackageMapping {
return PackageMapping{Name: "hyprland", Repository: RepoTypeSystem}
}So --git-deps hyprland (or --git) on Arch passes the CanToggle check, marks hyprland for reinstall here, and then categorizePackages resolves it back to the plain hyprland package — the user is told they're getting git and instead gets a pointless reinstall of the stable package they already have. Headless had no reinstall path before this PR, so the wasted rebuild is new.
Resolving the mapping and only marking a dep when the git and stable package names actually differ would keep --git-deps hyprland from lying, and would let the unknown-variant case return an error instead of silently installing stable.
Claude reviewTwo minor issues; the flag plumbing,
Checked: git-variant/reinstall interaction with |
|
/claude review |
Claude reviewNo issues found. Both findings from the previous review are fixed, and the rest of the change holds up. Checked: |
Description
This change fixes #3043 making it sure that user can set all the flags wanted & then run install without any interaction
Type of change
Related issues
Fixes #3043
Screenshots / video
No user facing change only adds flags to the install script tested on my forked repo.
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warningsNote: I have no experience of go language as well as entire change is made by AI :: Gemini basically Docs are not created but will create as soon as someone with the knowledge of GO lang conforms the changes are correct or is there any change.
Write Now there is install_script_flags.md flie for the list of flags but can be removed after approval & changes on docs are done.