Skip to content
Snippets Groups Projects
Commit 4a7eba86 authored by Timur Gandjelashvili's avatar Timur Gandjelashvili
Browse files

git-archive-all bug fix

parent 2dd9457b
No related branches found
No related tags found
No related merge requests found
......@@ -187,7 +187,9 @@ while test $# -gt 0; do
done
OLD_PWD="`pwd`"
TMPDIR=${TMPDIR:-/tmp}
#TMPDIR=${TMPDIR:-/tmp} # Timur Gandjelashvili bug fix
TMPDIR=`mktemp -d` # Timur Gandjelashvili bug fix - creating temporary dir
TMPFILE=`mktemp "$TMPDIR/$PROGRAM.XXXXXX"` # Create a place to store our work's progress
TMPLIST=`mktemp "$TMPDIR/$PROGRAM.submodules.XXXXXX"`
TOARCHIVE=`mktemp "$TMPDIR/$PROGRAM.toarchive.XXXXXX"`
......@@ -226,6 +228,7 @@ if [ $VERBOSE -eq 1 ]; then
echo "done"
fi
echo $TMPDIR/$(basename "$(pwd)").$FORMAT >| $TMPFILE # clobber on purpose
superfile=`head -n 1 $TMPFILE`
if [ $VERBOSE -eq 1 ]; then
......@@ -269,6 +272,7 @@ fi
if [ $VERBOSE -eq 1 ]; then
echo -n "concatenating archives into single archive..."
fi
# Concatenate archives into a super-archive.
if [ $SEPARATE -eq 0 -o "-" == "$OUT_FILE" ]; then
if [ $FORMAT == 'tar.gz' ]; then
......@@ -293,7 +297,6 @@ if [ $SEPARATE -eq 0 -o "-" == "$OUT_FILE" ]; then
done
cd "$OLD_PWD"
fi
echo "$superfile" >| $TMPFILE # clobber on purpose
fi
if [ $VERBOSE -eq 1 ]; then
......@@ -303,6 +306,7 @@ fi
if [ $VERBOSE -eq 1 ]; then
echo -n "moving archive to $OUT_FILE..."
fi
while read file; do
if [ "-" == "$OUT_FILE" ]; then
cat "$file" && rm -f "$file"
......@@ -310,6 +314,7 @@ while read file; do
mv "$file" "$OUT_FILE"
fi
done < $TMPFILE
rm -rf $TMPDIR
if [ $VERBOSE -eq 1 ]; then
echo "done"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment