[projects/git-slug: 91/170] Change mktemp in trash script to process number
glen
glen at pld-linux.org
Mon Sep 21 21:46:27 CEST 2015
commit 3d048a76d7360e4c43e7afb22de624d0c628820d
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Tue Mar 13 15:49:20 2012 +0000
Change mktemp in trash script to process number
The trash script used to close close the file in watchdir twice: first
by mktemp then by redirection and sometimes it confused the slug_watch.
On the other hand we do not need to be super secure with creating files
in watchdir, so using the process number to generate file name is
sufficient and avoids the problem mentioned above.
trash | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/trash b/trash
index 3dda75a..7db4d6d 100755
--- a/trash
+++ b/trash
@@ -22,6 +22,6 @@ echo "Repository removed by $GL_USER" > $repo/.gitolite.down
( echo $GL_USER
echo $1
GIT_DIR=$repo git for-each-ref --format="%(objectname) $EMPTYSHA1 %(refname)" refs/heads/\*
- ) > $WATCHDIR/`mktemp $1.XXXXXX`
+ ) > $WATCHDIR/$1.$$
mv $repo $ATTIC
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5
More information about the pld-cvs-commit
mailing list