This commit is contained in:
2026-02-19 21:41:53 +02:00
parent 747d1e01e1
commit ea69b43444

View File

@@ -456,6 +456,7 @@ in
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
TimeoutStartSec = "30min";
}; };
script = '' script = ''
set -euo pipefail set -euo pipefail
@@ -478,10 +479,25 @@ in
exit 1 exit 1
fi fi
rm -rf "${preparedSourcePath}" marker_file="${preparedSourcePath}/.wafrn-source-origin"
mkdir -p "${preparedSourcePath}" need_refresh=1
cp -a "$selected_source/." "${preparedSourcePath}/" if [ -f "$marker_file" ]; then
chmod -R u+w "${preparedSourcePath}" if [ "$(cat "$marker_file")" = "$selected_source" ]; then
need_refresh=0
fi
fi
if [ "$need_refresh" -eq 1 ]; then
echo "wafrn-nix: preparing source tree from $selected_source" >&2
rm -rf "${preparedSourcePath}"
mkdir -p "${preparedSourcePath}"
cp -a "$selected_source/." "${preparedSourcePath}/"
chmod -R u+w "${preparedSourcePath}"
printf '%s' "$selected_source" > "$marker_file"
else
echo "wafrn-nix: reusing prepared source tree" >&2
chmod -R u+w "${preparedSourcePath}"
fi
if [ ! -e "${preparedSourcePath}/.git" ]; then if [ ! -e "${preparedSourcePath}/.git" ]; then
mkdir -p "${preparedSourcePath}/.git" mkdir -p "${preparedSourcePath}/.git"