ensureNewerSourcesHook
pkgs.ensureNewerSourcesHook
Docs pulled from | This Revision | 26 minutes ago
Contribute
Enhance the ecosystem with your expertise! Contribute to fill the gaps in documentation. Your input can make a difference.
Noogle detected
Implementation
The following is the current implementation of this function.
{ year }:
makeSetupHook
{
name = "ensure-newer-sources-hook";
meta.license = lib.licenses.mit;
}
(
writeScript "ensure-newer-sources-hook.sh" ''
postUnpackHooks+=(_ensureNewerSources)
_ensureNewerSources() {
local r=$sourceRoot
# Avoid passing option-looking directory to find. The example is diffoscope-269:
# https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/378
[[ $r == -* ]] && r="./$r"
'${findutils}/bin/find' "$r" \
'!' -newermt '${year}-01-01' -exec touch -h -d '${year}-01-02' '{}' '+'
}
''
)