From 59aa5d0e41cf4a6d4356673feb1adbd0fcf68936 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Mar 2023 07:13:59 +0100 Subject: populate pass: calculate hash for each symlink this fixes folders with symlinks not getting updated if the symlinked file is in another subfolder of the pass repo --- pkgs/populate/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix index 7edb66b..80e2b96 100644 --- a/pkgs/populate/default.nix +++ b/pkgs/populate/default.nix @@ -119,7 +119,15 @@ let umask 0077 if test -e ${quote source.dir}/.git; then - local_pass_info=${quote source.name}\ $(${git}/bin/git -C ${quote source.dir} log -1 --format=%H ${quote source.name}) + local_pass_info=${quote source.name}\ $( + ${git}/bin/git -C ${quote source.dir} log -1 --format=%H ${quote source.name} + # we append a hash for every symlink, otherwise we would miss updates on + # files where the symlink points to + ${findutils}/bin/find ${quote source.dir}/${quote source.name} -type l \ + -exec ${coreutils}/bin/realpath {} + | + ${coreutils}/bin/sort | + ${findutils}/bin/xargs -r -n 1 ${git}/bin/git -C ${quote source.dir} log -1 --format=%H + ) remote_pass_info=$(${runShell target /* sh */ '' cat ${quote target.path}/.pass_info || : ''}) -- cgit v1.2.3