summaryrefslogtreecommitdiff
path: root/update-ignore.d
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2009-02-28 23:46:57 +0100
committerJoey Hess <joey@gnu.kitenet.net>2009-02-28 19:53:17 -0500
commit3b362a9abf4fdbe3d2103b2aa13c86b8c2613726 (patch)
tree424a4e7b240b29effc505c8463511b6e7cfd3db0 /update-ignore.d
parent4c601e07ff344d24cc0b85753030c19c9dcdbc76 (diff)
update-ignore.d/01update-ignore: add support for mktemp
On system where tempname is not installed, check if we could use mktemp instead. If we are at it, add a warning if neither of them is available. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Diffstat (limited to 'update-ignore.d')
-rwxr-xr-xupdate-ignore.d/01update-ignore9
1 files changed, 8 insertions, 1 deletions
diff --git a/update-ignore.d/01update-ignore b/update-ignore.d/01update-ignore
index 8156437..510e13f 100755
--- a/update-ignore.d/01update-ignore
+++ b/update-ignore.d/01update-ignore
@@ -126,7 +126,14 @@ if [ -e "$file" ]; then
exit 1
fi
realfile="$file"
- file=$(tempfile)
+ if [ -n "`type -p tempfile`" ]; then
+ tempfile="tempfile"
+ elif [ -n "`type -p mktemp`" ]; then
+ tempfile="mktemp"
+ else
+ echo "etckeeper warning: can't find tempfile or mktemp" >&2
+ fi
+ file=$($tempfile)
(
skipping=
while read line; do