diff options
| author | Marwan Aljubeh <marwan.aljubeh@gmail.com> | 2023-03-07 12:53:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 12:53:20 +0000 |
| commit | e62b83a934ea44d6da145cfe02b2d401d95d174f (patch) | |
| tree | 3115c40ed3ee8789e30e80b60f7db92546a78300 /modules/system | |
| parent | 87b9d090ad39b25b2400029c64825fc2a8868943 (diff) | |
Fix system.patches
Currently, `system.patches` doesn't work because it will attempt to first detect if the patch has already been applied by checking if it can be applied in reverse.
However, when that happens, `patch` detects that the supplied patch is incorrectly reversed and attempts to ask the user if they want to "Ignore -R":
```
Unreversed (or previously applied) patch detected! Ignore -R? [y]
```
Because the output is piped to `/dev/null` the user will basically see nothing and `darwin-rebuild switch` will hang until the user presses "Enter" (possibly to check if the terminal is frozen). At which point, patch will ignore the --reverse and exit successfully, preventing the patch from being applied at all.
This change fixes that bug by using `--force` which tells patch that we know what we're doing and prevents it from prompting the user if they want to ignore `--reverse`.
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/patches.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/system/patches.nix b/modules/system/patches.nix index 92f45c1..bb384e8 100644 --- a/modules/system/patches.nix +++ b/modules/system/patches.nix @@ -62,7 +62,7 @@ in ${concatMapStringsSep "\n" (f: '' f="$(basename ${f})" - if ! patch --reverse --dry-run -d / -p1 < '${f}' &> /dev/null; then + if ! patch --force --reverse --dry-run -d / -p1 < '${f}' &> /dev/null; then patch --forward --backup -d / -p1 < '${f}' || true fi '') cfg.patches} |
