linaro-vendor-package: Rework to generate versioned paths
This reworks the package generation in a way similar to what
SteveM wanted with versioned paths.
It also cleans up how we generate the tarball so it
doesn't assume we are in the AOSP tree.
Also folded in LINARO_VENDOR_PATH usage from Amit.
Signed-off-by: John Stultz <john.stultz@lianro.org>
diff --git a/generate_vendor_package.sh b/generate_vendor_package.sh
new file mode 100755
index 0000000..7fbb237
--- /dev/null
+++ b/generate_vendor_package.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -x
+
+SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+
+DATE=$(date +%Y%m%d)
+SHA1=$(git log --pretty="%h" HEAD~1..HEAD)
+VER=$DATE
+
+SRC_DIR=$SCRIPT_DIR/src/
+TARGET_DIR=out/vendor/linaro-devices/$VER/
+
+
+#Create and copy the files into the out dir
+mkdir -p $TARGET_DIR
+cp -r $SRC_DIR/* $TARGET_DIR
+
+# set the version file in the package
+echo "TARGET_LINARO_VENDOR_VERSION := $VER" > $TARGET_DIR/version.mk
+
+#tar it up
+tar -C out -czf out/vendor.tgz vendor/
+
+# prepend the extraction script
+cp $SCRIPT_DIR/extract-linaro_devices.sh-source out/extract-linaro_devices-$VER.sh
+cat out/vendor.tgz >> out/extract-linaro_devices-$VER.sh
+
+# tar it again
+tar -C out -czf out/extract-linaro_devices-$VER.tgz extract-linaro_devices-$VER.sh
+
+# cleanup: remove the temp/intermediate files
+rm out/extract-linaro_devices-$VER.sh out/vendor.tgz
+rm -rf out/vendor