fix(install_config): replace cp -nv with explicit file existence check#4897
Merged
fix(install_config): replace cp -nv with explicit file existence check#4897
Conversation
Newer coreutils (Ubuntu 24.04+, Debian 13+) emit a portability warning when using cp -n: 'behavior of -n is non-portable and may change in future'. Replace all cp -nv usages with an explicit [ ! -f dest ] guard, which is portable across all distros and preserves the same OK/SKIP/FAIL behaviour.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the LinuxGSM config installation flow to avoid coreutils warnings emitted by cp -n, which were breaking mid-line OK/SKIP/FAIL formatting during config copy output.
Changes:
- Replaced
cp -nvusage in remote default-config installs with an explicit destination existence check plus a plaincp. - Preserved OK/SKIP/FAIL printing by setting
changesonly when a copy occurs and leaving it empty when skipping.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Using only -f missed broken symlinks (-e returns false for them but -L returns true). Use both checks to match the skip behaviour of cp -n.
This was referenced Apr 19, 2026
Merged
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.
Description
Newer versions of coreutils (Ubuntu 24.04+, Debian 13+, Rocky Linux 9+) changed the behaviour of
cp -n, either emitting a portability warning or rejecting the--updateargument entirely, breaking the config file copy step during install.cp -nvcalls ininstall_config.shwith an explicit[ ! -f dest ]existence check before copyingFixes #4700
Type of change
Checklist
PR will not be merged until all steps are complete.
developbranch as its base.Documentation
If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.
Thank you for your Pull Request!