mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
use --dry-run check to re-apply system patches
This commit is contained in:
parent
7e4b134554
commit
3cf11923eb
1 changed files with 10 additions and 6 deletions
|
@ -29,6 +29,10 @@ in
|
||||||
description = ''
|
description = ''
|
||||||
Set of patches to apply to <filename>/</filename>.
|
Set of patches to apply to <filename>/</filename>.
|
||||||
|
|
||||||
|
<warning>
|
||||||
|
<para>This can modify everything so use with caution.</para>
|
||||||
|
</warning>
|
||||||
|
|
||||||
Useful for safely changing system files. Unlike the etc module this
|
Useful for safely changing system files. Unlike the etc module this
|
||||||
won't remove or modify files with unexpected content.
|
won't remove or modify files with unexpected content.
|
||||||
'';
|
'';
|
||||||
|
@ -56,12 +60,12 @@ in
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
${concatMapStringsSep "\n" (f: ''
|
${concatMapStringsSep "\n" (f: ''
|
||||||
f="$(basename ${f})"
|
f="$(basename ${f})"
|
||||||
if ! diff "${cfg.build.patches}/patches/$f" "/run/current-system/patches/$f" &> /dev/null; then
|
if ! patch --reverse --dry-run -d / -p1 < '${f}' &> /dev/null; then
|
||||||
patch --forward --backup -d / -p1 < '${f}' || true
|
patch --forward --backup -d / -p1 < '${f}' || true
|
||||||
fi
|
fi
|
||||||
'') cfg.patches}
|
'') cfg.patches}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue