[freedesktop-sdk-base] Properly extract every image built based on git sha-1



commit 8e6d1e5b50a962710a63f544531b6676513ed565
Author: Alexander Larsson <alexl spinner gnome org>
Date:   Thu Mar 26 12:38:28 2015 +0000

    Properly extract every image built based on git sha-1

 .gitignore                  |    1 +
 Makefile                    |   10 ++++++----
 freedesktop-sdk-build-yocto |    9 +++++----
 3 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c291c09
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+images
diff --git a/Makefile b/Makefile
index 56f71cf..7c6656c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,13 @@ builddir = $(CURDIR)
 
 NULL=
 ARCH=x86_64
-IMAGES=build/$(ARCH)/images
+IMAGEDIR=images/$(ARCH)
+HASH:=$(shell git rev-parse HEAD)
+IMAGES=$(IMAGEDIR)/freedesktop-base-contents-sdk-$(ARCH)-$(HASH).tar.gz 
$(IMAGEDIR)/freedesktop-base-contents-platform-$(ARCH)-$(HASH).tar.gz
 
-all: images
+all: $(IMAGES)
 
-$(IMAGES)/freedesktop-base-contents-sdk-$(ARCH).tar.gz 
$(IMAGES)/freedesktop-base-contents-platform-$(ARCH).tar.gz images:
+ $(IMAGES) allimages:
        git submodule update --init
        mkdir -p build/$(ARCH)
-       ./freedesktop-sdk-build-yocto ${srcdir}/ ${builddir}/build/ $(ARCH) `git rev-parse HEAD`
+       ./freedesktop-sdk-build-yocto $(srcdir)/ $(builddir)/build/ $(ARCH) $(HASH)
diff --git a/freedesktop-sdk-build-yocto b/freedesktop-sdk-build-yocto
index e1b1960..259422f 100755
--- a/freedesktop-sdk-build-yocto
+++ b/freedesktop-sdk-build-yocto
@@ -39,6 +39,9 @@ test -n "${architecture}" || (usage; exit 1)
 HASH=$4
 test -n "${HASH}" || (usage; exit 1)
 
+IMAGEDIR=${srcdir}/images/${architecture}
+mkdir -p $IMAGEDIR
+
 . "${srcdir}/yocto/oe-init-build-env" "${workdir}/${architecture}"
 
 LAYERNAMES=$(cat ${srcdir}/LAYERS)
@@ -89,11 +92,9 @@ EOF
     mv ${localconf}.tmp ${localconf}
 fi
 
-IMAGEDIR=${workdir}/${architecture}/images
-mkdir -p "${IMAGEDIR}"
-
 bitbake freedesktop-contents-{sdk,platform}
+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
 
 for basetype in sdk platform; do
-    ln -sf 
${workdir}/${architecture}/tmp-glibc/deploy/images/${MACHINE}/freedesktop-contents-${basetype}-${MACHINE}.tar.gz
 images/freedesktop-contents-${basetype}-${architecture}-${HASH}.tar.gz
+    ln -f 
${workdir}/${architecture}/tmp-glibc/deploy/images/${MACHINE}/freedesktop-contents-${basetype}-${MACHINE}.tar.gz
 $IMAGEDIR/freedesktop-contents-${basetype}-${architecture}-${HASH}.tar.gz
 done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]