aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-12-09 12:08:45 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-12-09 12:08:45 +0100
commit993c3283a9e6a00fcb6b747d54f281caf6f4b681 (patch)
tree01133013bdfc8bb582db736289ab79c322730179 /pkgs
parentpkgs/notify-run: Append the name of the spawned command before printing (diff)
downloadnixos-config-993c3283a9e6a00fcb6b747d54f281caf6f4b681.zip
treewide: Give tempfiles descriptive names
This makes it easier to see, where each tempfile comes from.
Diffstat (limited to 'pkgs')
-rwxr-xr-xpkgs/by-name/fu/fupdate-sys/fupdate-sys.sh2
-rwxr-xr-xpkgs/by-name/gi/git-edit-index/git-edit-index.sh2
-rwxr-xr-xpkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh2
-rwxr-xr-xpkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh2
-rwxr-xr-xpkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh2
-rwxr-xr-xpkgs/update_pkgs.sh2
6 files changed, 6 insertions, 6 deletions
diff --git a/pkgs/by-name/fu/fupdate-sys/fupdate-sys.sh b/pkgs/by-name/fu/fupdate-sys/fupdate-sys.sh
index 4ec3e9e8..991830b3 100755
--- a/pkgs/by-name/fu/fupdate-sys/fupdate-sys.sh
+++ b/pkgs/by-name/fu/fupdate-sys/fupdate-sys.sh
@@ -151,7 +151,7 @@ msg2 "Updating git repository..."
git pull --rebase
# We use a tempfile, to make this truly async.
-default_branch=$(mktemp)
+default_branch=$(mktemp fupdate_flake_XXXX)
cleanup() {
rm "$default_branch"
}
diff --git a/pkgs/by-name/gi/git-edit-index/git-edit-index.sh b/pkgs/by-name/gi/git-edit-index/git-edit-index.sh
index 46fbc9c5..a78db1e0 100755
--- a/pkgs/by-name/gi/git-edit-index/git-edit-index.sh
+++ b/pkgs/by-name/gi/git-edit-index/git-edit-index.sh
@@ -56,7 +56,7 @@ materialize_file() {
}
edit() {
- files_to_add="$(mktemp)"
+ files_to_add="$(mktemp git_edit_index_XXXXX)"
cleanup() {
rm "$files_to_add"
}
diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh b/pkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh
index 90ebe1ce..efe8fe79 100755
--- a/pkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh
+++ b/pkgs/by-name/lf/lf-make-map/tests/cases/child_insert/test.sh
@@ -10,7 +10,7 @@
# You should have received a copy of the License along with this program.
# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
-test="$(mktemp --directory)"
+test="$(mktemp --directory lf_make_map_test_XXXX)"
cleanup() {
rm --recursive "$test"
diff --git a/pkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh
index 6e127d28..656fd2a1 100755
--- a/pkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh
+++ b/pkgs/by-name/lf/lf-make-map/tests/cases/simple/test.sh
@@ -12,7 +12,7 @@
# We need to hard code this, so that our output matches the golden sample.
base="/tmp/tmp.DfcgjemfCG"
-test="$(mktemp --directory)"
+test="$(mktemp --directory lf_make_temp_test_XXXXX)"
[ -d "$base" ] && {
echo "$base already exists!"
diff --git a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh
index 0eeb75c0..dfaed457 100755
--- a/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh
+++ b/pkgs/by-name/sc/screenshot_persistent/screenshot_persistent.sh
@@ -10,7 +10,7 @@
# shellcheck shell=bash
-tmp="$(mktemp)"
+tmp="$(mktemp screenshot_persistent_XXXXX)"
if grim -g "$(slurp)" "$tmp"; then
name="$(rofi -dmenu -p "Name of screenshot: " -l 0)"
diff --git a/pkgs/update_pkgs.sh b/pkgs/update_pkgs.sh
index d046ee76..32fc6758 100755
--- a/pkgs/update_pkgs.sh
+++ b/pkgs/update_pkgs.sh
@@ -19,7 +19,7 @@ cd "$(dirname "$0")" || die "Bug: run with the wrong first arg: '$0'!"
cd ./by-name || die "(BUG): The directory './by-name' does not exist?"
# First check if all the update scripts conform to the standard
-files_with_update="$(mktemp)"
+files_with_update="$(mktemp update_pkgs_XXXXX)"
trap 'rm "$files_with_update"' EXIT
fd '^update.sh$' . --type file --extension sh --max-depth 3 | while read -r file; do