From 993c3283a9e6a00fcb6b747d54f281caf6f4b681 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Tue, 9 Dec 2025 12:08:45 +0100 Subject: treewide: Give tempfiles descriptive names This makes it easier to see, where each tempfile comes from. --- modules/by-name/bo/boot/module.nix | 2 +- modules/by-name/lf/lf/commands/base.sh | 4 ++-- modules/by-name/lf/lf/module.nix | 2 +- modules/by-name/lf/lf/wrappers/ll/ll.sh | 2 +- modules/by-name/ni/nixos-shell/nixos-shell.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/by-name/bo/boot/module.nix b/modules/by-name/bo/boot/module.nix index dfcd14b7..4b95aedf 100644 --- a/modules/by-name/bo/boot/module.nix +++ b/modules/by-name/bo/boot/module.nix @@ -46,7 +46,7 @@ in { # # stay on disk forever) <2024-05-11> # copyExtraFiles = '' # echo "[systemd-boot] copying files to ${bootMountPoint}" - # empty_file=$(mktemp) + # empty_file=$(mktemp boot_empty_file_XXX) # # ${lib.concatStrings (lib.mapAttrsToList (n: v: # /* diff --git a/modules/by-name/lf/lf/commands/base.sh b/modules/by-name/lf/lf/commands/base.sh index 99852c3e..7c6851c0 100755 --- a/modules/by-name/lf/lf/commands/base.sh +++ b/modules/by-name/lf/lf/commands/base.sh @@ -41,11 +41,11 @@ prompt() { # set -- "$@" "$file" # done < "$(echo "$fx" | tmp)" tmp() { - __base_tmp_temporary_file="$(mktemp --tmpdir="$__base_tmp_temporary_directory")" + __base_tmp_temporary_file="$(mktemp --tmpdir="$__base_tmp_temporary_directory" lf_commands_tmp_fun_XXXXXXXX )" cat >"$__base_tmp_temporary_file" echo "$__base_tmp_temporary_file" } -__base_tmp_temporary_directory="$(mktemp --directory)" +__base_tmp_temporary_directory="$(mktemp --directory lf_commands_tmp_fun_XXXXXXXXXXXX)" trap 'rm --recursive "$__base_tmp_temporary_directory"' EXIT # Run a lf command on the current lf client diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix index e66c3a8a..28b627bd 100644 --- a/modules/by-name/lf/lf/module.nix +++ b/modules/by-name/lf/lf/module.nix @@ -100,7 +100,7 @@ in { # and keep running through `autoquit = false`. # (Otherwise, the remote command is silently dropped: https://github.com/gokcehan/lf/issues/495) &{{ - tmp="$(mktemp)" + tmp="$(mktemp lf_make_map_dynamic_mapping_source_XXXXX)" ${lib.getExe pkgs.lf-make-map} --depth 4 generate ~/media ~/repos ~/documents >"$tmp" lf -remote "send $id source $tmp" diff --git a/modules/by-name/lf/lf/wrappers/ll/ll.sh b/modules/by-name/lf/lf/wrappers/ll/ll.sh index e012cffa..462e03db 100755 --- a/modules/by-name/lf/lf/wrappers/ll/ll.sh +++ b/modules/by-name/lf/lf/wrappers/ll/ll.sh @@ -10,7 +10,7 @@ # You should have received a copy of the License along with this program. # If not, see . -last_directory="$(mktemp)" +last_directory="$(mktemp ll_last_directory_XXXXXXX)" cleanup() { rm "$last_directory" } diff --git a/modules/by-name/ni/nixos-shell/nixos-shell.sh b/modules/by-name/ni/nixos-shell/nixos-shell.sh index 390e60b1..99476e9d 100755 --- a/modules/by-name/ni/nixos-shell/nixos-shell.sh +++ b/modules/by-name/ni/nixos-shell/nixos-shell.sh @@ -10,7 +10,7 @@ # You should have received a copy of the License along with this program. # If not, see . -SHARED_DIR="$(mktemp --directory)" +SHARED_DIR="$(mktemp --directory "nixos_shell_XXXXXXXXX")" cleanup() { rm --recursive "$SHARED_DIR" } -- cgit 1.4.1