summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-11-30 09:02:46 +0100
committerlassulus <lassulus@lassul.us>2018-11-30 22:28:16 +0100
commiteb68146cc4848cfc0c0339c72a44a96fdeb4a1de (patch)
treec679e7d52b1e7e4131e7b012ac65a6a3b74d3c4b
parent4017c60485c4bfff533ff11bdbb5557fa951655f (diff)
populate pass: check if already up to datecheck-pass
-rw-r--r--pkgs/populate/default.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix
index b5b8a7b..939ffb3 100644
--- a/pkgs/populate/default.nix
+++ b/pkgs/populate/default.nix
@@ -60,6 +60,17 @@ let
in /* sh */ ''
umask 0077
+ if test -e ${quote source.dir}/.git; then
+ local_pass_info=${quote source.name}\ $(${git}/bin/git -C ${quote source.dir} rev-parse HEAD)
+ remote_pass_info=$(${shell' target /* sh */ ''
+ cat ${quote target.path}/.pass_info || :
+ ''})
+
+ if test "$local_pass_info" = "$remote_pass_info"; then
+ exit 0
+ fi
+ fi
+
tmp_dir=$(${coreutils}/bin/mktemp -dt populate-pass.XXXXXXXX)
trap cleanup EXIT
cleanup() {
@@ -83,6 +94,10 @@ let
${coreutils}/bin/touch -d "$pass_date" "$tmp_path"
done
+ if test -n "''${local_pass_info-}"; then
+ echo "$local_pass_info" > "$tmp_dir"/.pass_info
+ fi
+
${rsync' target {} /* sh */ "$tmp_dir"}
'';