diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2018-10-31 13:00:37 +0200 |
---|---|---|
committer | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2018-10-31 14:50:52 +0000 |
commit | dd7ede32632c6452c10aa424800c60a09cc42c8a (patch) | |
tree | b2781b1ca11f665d78baa13d690a84eb69e97613 /b2qt-init-build-env | |
parent | 57a4d19ca861752e1bcc5322bbf606d543e192d9 (diff) | |
download | meta-boot2qt-dd7ede32632c6452c10aa424800c60a09cc42c8a.tar.gz |
Add optional init parameter to use non-default manifest directory
Change-Id: Ica95ea5a7b8fb3fff371c161a11dd9104e56d403
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'b2qt-init-build-env')
-rwxr-xr-x | b2qt-init-build-env | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/b2qt-init-build-env b/b2qt-init-build-env index f39a940..66ae73b 100755 --- a/b2qt-init-build-env +++ b/b2qt-init-build-env | |||
@@ -34,9 +34,10 @@ usage() { | |||
34 | echo "Usage: $(basename $0) COMMAND [ARGS]" | 34 | echo "Usage: $(basename $0) COMMAND [ARGS]" |
35 | echo | 35 | echo |
36 | echo "Initialize build environment:" | 36 | echo "Initialize build environment:" |
37 | echo " $(basename $0) init --device <name> [--reference <mirror path>] [--internal]" | 37 | echo " $(basename $0) init --device <name> [--reference <mirror path>] [--manifest-dir <dir path>] [--internal]" |
38 | echo " --device <name>: target device name or 'all'" | 38 | echo " --device <name>: target device name or 'all'" |
39 | echo " --reference <mirror path>: path to local mirror, initialized previously with '$(basename $0) mirror'" | 39 | echo " --reference <mirror path>: path to local mirror, initialized previously with '$(basename $0) mirror'" |
40 | echo " --manifest-dir <dir path>: path to a directory containing repo manifest file(s)" | ||
40 | echo " --internal: fetch internal repositories, available only inside The Qt Company network." | 41 | echo " --internal: fetch internal repositories, available only inside The Qt Company network." |
41 | echo "Initialize local mirror:" | 42 | echo "Initialize local mirror:" |
42 | echo " $(basename $0) mirror" | 43 | echo " $(basename $0) mirror" |
@@ -62,6 +63,10 @@ while test -n "$1"; do | |||
62 | shift | 63 | shift |
63 | REPO_URL="--repo-url $1" | 64 | REPO_URL="--repo-url $1" |
64 | ;; | 65 | ;; |
66 | "--manifest-dir") | ||
67 | shift | ||
68 | MANIFEST_DIR=$1 | ||
69 | ;; | ||
65 | "--internal") | 70 | "--internal") |
66 | INTERNAL="y" | 71 | INTERNAL="y" |
67 | ;; | 72 | ;; |
@@ -87,6 +92,10 @@ if [ -n "${REFERENCE}" ]; then | |||
87 | REFERENCE="--reference $(readlink -f ${REFERENCE})" | 92 | REFERENCE="--reference $(readlink -f ${REFERENCE})" |
88 | fi | 93 | fi |
89 | 94 | ||
95 | if [ -n "${MANIFEST_DIR}" ]; then | ||
96 | MANIFEST_DIR="$(readlink -f ${MANIFEST_DIR})" | ||
97 | fi | ||
98 | |||
90 | if [ -z "${REPO_URL}" ]; then | 99 | if [ -z "${REPO_URL}" ]; then |
91 | REPO_URL="--repo-url git://github.com/theqtcompany/git-repo" | 100 | REPO_URL="--repo-url git://github.com/theqtcompany/git-repo" |
92 | fi | 101 | fi |
@@ -161,9 +170,18 @@ list_devices() { | |||
161 | done | 170 | done |
162 | } | 171 | } |
163 | 172 | ||
164 | mirror() { | 173 | copy_manifests() { |
165 | mkdir -p .repo/manifests | 174 | mkdir -p .repo/manifests |
166 | cp ${DIR}/scripts/manifest.xml .repo/manifests/ | 175 | rm -f .repo/manifests/manifest*.xml |
176 | if [ -z "${MANIFEST_DIR}" ]; then | ||
177 | cp ${DIR}/scripts/manifest*.xml .repo/manifests/ | ||
178 | else | ||
179 | cp ${MANIFEST_DIR}/manifest*.xml .repo/manifests/ | ||
180 | fi | ||
181 | } | ||
182 | |||
183 | mirror() { | ||
184 | copy_manifests | ||
167 | MANIFEST="manifest.xml" | 185 | MANIFEST="manifest.xml" |
168 | DEVICE=${DEVICE:-all} | 186 | DEVICE=${DEVICE:-all} |
169 | get_groups | 187 | get_groups |
@@ -179,9 +197,7 @@ init() { | |||
179 | fi | 197 | fi |
180 | 198 | ||
181 | get_groups | 199 | get_groups |
182 | mkdir -p .repo/manifests | 200 | copy_manifests |
183 | rm -f .repo/manifests/manifest*.xml | ||
184 | cp ${DIR}/scripts/manifest*.xml .repo/manifests | ||
185 | if [ -f .repo/manifests/manifest_${DEVICE}.xml ]; then | 201 | if [ -f .repo/manifests/manifest_${DEVICE}.xml ]; then |
186 | MANIFEST="manifest_${DEVICE}.xml" | 202 | MANIFEST="manifest_${DEVICE}.xml" |
187 | else | 203 | else |