Patchwork [2/2] scripts/oe-setup-rpmrepo: use setup_tmpdir from runqemu

login
register
mail settings
Submitter Paul Eggleton
Date Sept. 28, 2011, 9:26 a.m.
Message ID <1ec286b2573498bed6e68bfb913fce101e4e7e6e.1317201529.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/12311/
State New, archived
Headers show

Comments

Paul Eggleton - Sept. 28, 2011, 9:26 a.m.
Update the internal copy of setup_tmpdir in the oe-setup-rpmrepo script
to be the same as the one in the runqemu script.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/oe-setup-rpmrepo |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

Patch

diff --git a/scripts/oe-setup-rpmrepo b/scripts/oe-setup-rpmrepo
index fc2f7a8..ea885f6 100755
--- a/scripts/oe-setup-rpmrepo
+++ b/scripts/oe-setup-rpmrepo
@@ -35,19 +35,20 @@  fi
 
 setup_tmpdir() {
     if [ -z "$TMPDIR" ]; then
-        if [ "x$BUILDDIR" = "x" -o ! -d "$BUILDDIR/tmp" ]; then
-            # BUILDDIR unset, try and get TMPDIR from bitbake
-            type -P bitbake &>/dev/null || {
-                echo "In order for this script to dynamically infer paths";
-                echo "to kernels or filesystem images, you either need";
-                echo "bitbake in your PATH or to source oe-init-build-env";
-                echo "before running this script" >&2;
-                exit 1; }
-
-            # We have bitbake in PATH, get TMPDIR from bitbake
-            TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
-        else
-            TMPDIR=$BUILDDIR/tmp
+        # Try to get TMPDIR from bitbake
+        type -P bitbake &>/dev/null || {
+            echo "In order for this script to dynamically infer paths";
+            echo "to kernels or filesystem images, you either need";
+            echo "bitbake in your PATH or to source oe-init-build-env";
+            echo "before running this script" >&2;
+            exit 1; }
+
+        # We have bitbake in PATH, get TMPDIR from bitbake
+        TMPDIR=`bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
+        if [ -z "$TMPDIR" ]; then
+            echo "Error: this script needs to be run from your build directory,"
+            echo "or you need to explicitly set TMPDIR in your environment"
+            exit 1
         fi
     fi
 }