refuse to run if we can't write to HOME

This commit is contained in:
Joey Hess 2018-07-10 14:20:23 -04:00
parent eb08deefa5
commit a8a0f7fc58
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -132,7 +132,7 @@ export LOCPATH
for localecache in $HOME/.cache/git-annex/locales/*; do
cachebase=$(cat "$localecache/base" 2>/dev/null || true)
if [ ! -d "$cachebase" ] || ! cmp "$localecache/buildid" "$cachebase/buildid" >/dev/null ; then
rm -rf "$localecache"
rm -rf "$localecache" 2>&1 || true
fi
done
@ -140,7 +140,10 @@ done
if [ -e "$LOCPATH/buildid" ] && ! cmp "$LOCPATH/buildid" "$base/buildid" >/dev/null ; then
rm -rf "$LOCPATH"
fi
mkdir -p "$LOCPATH"
if ! mkdir -p "$LOCPATH"; then
echo "Unable to write to $LOCPATH; can't continue!" >&2
exit 1
fi
echo "$base" > "$LOCPATH/base"
cp "$base/buildid" "$LOCPATH/buildid"