aboutsummaryrefslogtreecommitdiff
path: root/maintainer-scripts
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-12-17 00:14:30 +0100
committerJakub Jelinek <jakub@redhat.com>2020-12-17 00:15:23 +0100
commitf4ae1f2c43d2274225f84f4370e556c4abd6010e (patch)
treea0c6a9a19c935c1c6692bd91937a82255884a376 /maintainer-scripts
parent2a4183234a45ba28db5ce16cf3ccdd70cdef3b7c (diff)
downloadgcc-f4ae1f2c43d2274225f84f4370e556c4abd6010e.zip
gcc-f4ae1f2c43d2274225f84f4370e556c4abd6010e.tar.gz
gcc-f4ae1f2c43d2274225f84f4370e556c4abd6010e.tar.bz2
maintainer-scripts: Use /sourceware/snapshot-tmp/gcc as temp directory if possible
> https://gcc.gnu.org/pipermail/gccadmin/2020q4/017037.html > > OSError: [Errno 28] No space left on device: > '/tmp/tmp.Zq3p6D4MxS/gcc/.git/objects/objn31xpefh' -> > '/tmp/tmp.Zq3p6D4MxS/gcc/.git/objects/db/ffb02a4bcdd4ec04af3db75d86b8cc2e52bdff' > > Maybe change the script to use /sourceware/snapshot-tmp/gcc (which has > rather more space) instead of /tmp? This patch implements that. 2020-12-17 Jakub Jelinek <jakub@redhat.com> * update_version_git: Put BASEDIR into /sourceware/snapshot-tmp/gcc if it exist.
Diffstat (limited to 'maintainer-scripts')
-rwxr-xr-xmaintainer-scripts/update_version_git19
1 files changed, 13 insertions, 6 deletions
diff --git a/maintainer-scripts/update_version_git b/maintainer-scripts/update_version_git
index 4ebeee5..cf51916 100755
--- a/maintainer-scripts/update_version_git
+++ b/maintainer-scripts/update_version_git
@@ -5,24 +5,31 @@
# commit messages.
GITROOT=${GITROOT:-"/git/gcc.git"}
+if [ -z "$TMPDIR" ]; then
+ if [ -d /sourceware/snapshot-tmp/gcc ]; then
+ TMPDIR=/sourceware/snapshot-tmp/gcc
+ else
+ TMPDIR=/tmp
+ fi
+fi
-# Run this from /tmp.
-export GITROOT
+# Run this from $TMPDIR.
+export GITROOT TMPDIR
BASEDIR=`mktemp -d`
cd "$BASEDIR"
GIT=${GIT:-/usr/local/bin/git}
# Assume all will go well.
-SUBDIR=$BASEDIR/gcc
+SUBDIR="$BASEDIR/gcc"
${GIT} clone -q -b master "$GITROOT" "$SUBDIR"
-cp -a $SUBDIR/contrib/gcc-changelog $BASEDIR/gcc-changelog
+cp -a "$SUBDIR"/contrib/gcc-changelog "$BASEDIR"/gcc-changelog
cd "$SUBDIR"
python3 ../gcc-changelog/git_update_version.py -p
RESULT=$?
-cd /tmp
+cd "$TMPDIR"
-/bin/rm -rf $BASEDIR
+/bin/rm -rf "$BASEDIR"
exit $RESULT