[ELDK] [PATCH 1/3] Use TMPDIR env variable to locate tmp files.
Phil Terry
pterry at vmetro.com
Tue Apr 22 00:57:06 CEST 2008
From: Phil Terry <pterry at micromemory.com>
The machine I was using to build on had /tmp and /var/tmp mounted with the root
file system with very little room left. ELDK_BUILD makes extensive long term
use of these locations so I ran into no space on device problems.
this patch uses the TMPDIR environment variable to locate these somewhere else.
If TMPDIR isn't set the original locations are used.
---
ELDK_BUILD | 2 +-
build.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ELDK_BUILD b/ELDK_BUILD
index 038140c..fb943f5 100755
--- a/ELDK_BUILD
+++ b/ELDK_BUILD
@@ -280,7 +280,7 @@ fi
#
echo "## SRPMS:"
-TMP_DIR=/tmp/pkg.$$
+TMP_DIR=${TMPDIR:-/tmp}/pkg.$$
case ${HOST_OS} in
linux) RPM_DIR=$TMP_DIR/`rpm --eval="%{_topdir}"` ;;
*) RPM_DIR=$TMP_DIR/usr/local/src/redhat ;;
diff --git a/build.sh b/build.sh
index 148eaff..6b7b0a2 100755
--- a/build.sh
+++ b/build.sh
@@ -152,7 +152,7 @@ build_package() {
cp $PCKG_PREFIX/$pname/SOURCES/* $RPM_BUILD_AREA/SOURCES
- tmpdir=`mktemp -d /var/tmp/eldk.XXXXXX`
+ tmpdir=`mktemp -d ${TMPDIR:-/var/tmp}/eldk.XXXXXX`
if [ $? -ne 0 ]; then
return 1
fi
@@ -418,7 +418,7 @@ build_rpm()
{
set -x
mkdir -p $BUILD_PREFIX/cross_rpms/rpm/BUILD
- tmpdir=`mktemp -d /var/tmp/eldk.XXXXXX`
+ tmpdir=`mktemp -d ${TMPDIR:-/var/tmp}/eldk.XXXXXX`
if [ $? -ne 0 ]; then
return 1
fi
--
1.5.4
More information about the eldk
mailing list