summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-03-13 07:13:59 +0100
committerlassulus <git@lassul.us>2023-03-13 10:49:57 +0100
commit59aa5d0e41cf4a6d4356673feb1adbd0fcf68936 (patch)
tree7406c92f5bc3534f4964c73eac33802fbed2b086
parent3ebbfc62615d4ba253a4dd96bac0f4b2128a2b6d (diff)
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
-rw-r--r--pkgs/populate/default.nix10
1 files changed, 9 insertions, 1 deletions
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 || :
''})