From 3da7d92dc8f3b193b4ea2c01121a2cab70a867d5 Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Sat, 18 Oct 2014 10:53:11 -0400 Subject: [PATCH] Renamed create-template-list.sh to create_template_list.sh; overwrite file each time --- Makefile | 2 +- create-template-list.sh => create_template_list.sh | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) rename create-template-list.sh => create_template_list.sh (93%) diff --git a/Makefile b/Makefile index c510f76..f5e65d4 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ rpms: sudo -E ./prepare_image prepared_images/$(TEMPLATE_NAME).img && \ sudo -E ./qubeize_image prepared_images/$(TEMPLATE_NAME).img $(TEMPLATE_NAME) && \ ./build_template_rpm $(TEMPLATE_NAME) || exit 1; \ - ./create-template-list.sh || : \ + ./create_template_list.sh || : \ update-repo-installer: [ -z "$$UPDATE_REPO" ] && UPDATE_REPO=../installer/yum/qubes-dom0;\ diff --git a/create-template-list.sh b/create_template_list.sh similarity index 93% rename from create-template-list.sh rename to create_template_list.sh index 0feaf73..260d3aa 100755 --- a/create-template-list.sh +++ b/create_template_list.sh @@ -6,26 +6,29 @@ TEMPLATES="./rpm/install-templates.sh" -TEMPLATES="$(readlink -m $TEMPLATES)" -touch "$TEMPLATES" write() { echo "$1" >> "$TEMPLATES" } -write "#!/bin/bash" -write "" - if [ -x /usr/sbin/xenstore-read ]; then XENSTORE_READ="/usr/sbin/xenstore-read" else XENSTORE_READ="/usr/bin/xenstore-read" fi +TEMPLATES="$(readlink -m $TEMPLATES)" VERSION="-$(cat ./version)" name=$($XENSTORE_READ name) path="$(readlink -m .)" files=$(ls rpm/noarch) +# +# Write to install-templates +# + +echo "#!/bin/bash" > "$TEMPLATES" +write "" + for file in ${files[@]}; do write "qvm-run --pass-io development-qubes 'cat ${path}/rpm/noarch/${file}' > ${file}" write ""