Merge lp:~dpigott/lava-master-image-scripts/license-wrap-change into lp:lava-master-image-scripts

Proposed by Dave Pigott
Status: Merged
Merged at revision: 42
Proposed branch: lp:~dpigott/lava-master-image-scripts/license-wrap-change
Merge into: lp:lava-master-image-scripts
Diff against target: 51 lines (+19/-11)
1 file modified
lava-create-master (+19/-11)
To merge this branch: bzr merge lp:~dpigott/lava-master-image-scripts/license-wrap-change
Reviewer Review Type Date Requested Status
Zygmunt Krynicki Pending
Review via email: mp+99552@code.launchpad.net

Description of the change

Add support so that if the license check isn't needed it gets bypassed (i.e. if we're in the Linaro office behind the firewall)

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava-create-master'
2--- lava-create-master 2012-03-23 14:38:16 +0000
3+++ lava-create-master 2012-03-27 15:53:31 +0000
4@@ -180,11 +180,17 @@
5 --user-agent="lava-create-master ($LAVA_VERSION)" \
6 --quiet \
7 "$2"; then
8- echo "Error: unable to download: $1" >&2
9+ if test -z "$LICENSE_WRAP"; then
10+ # don't report error if we might have to do license wrap
11+ echo "Error: unable to download: $1" >&2
12+ fi
13 return 1
14 fi
15 if ! check_md5_or_remove "$1" "$3"; then
16- echo "Error: checksum mismatch for $1" >&2
17+ if test -z "$LICENSE_WRAP"; then
18+ # don't report error if we might have to do license wrap
19+ echo "Error: checksum mismatch for $1" >&2
20+ fi
21 return 1
22 else
23 return 0
24@@ -265,16 +271,18 @@
25 if [ -e cache/$dev-vanilla.img ]; then
26 verbose " * Re-using existing vanilla image: cache/$dev-vanilla.img"
27 else
28- # Select the right download function and download hwpack
29- if test -n "$LICENSE_WRAP"; then
30- download_fn=${dev}_download_and_md5
31- else
32- download_fn=download_and_md5
33- fi
34+ # Try non-license download first in case we're in the lab
35 verbose " * Downloading/checking hardware pack..."
36- if ! $download_fn "cache/$HWPACK" "$HWPACK_URL" "$HWPACK_MD5"; then
37- echo "Error: unable to download hwpack" >&2
38- exit 1
39+ if ! download_and_md5 "cache/$HWPACK" "$HWPACK_URL" "$HWPACK_MD5"; then
40+ if test -n "$LICENSE_WRAP"; then
41+ if ! ${dev}_download_and_md5 "cache/$HWPACK" "$HWPACK_URL" "$HWPACK_MD5"; then
42+ echo "Error: unable to download hwpack/verify license" >&2
43+ exit 1
44+ fi
45+ else
46+ echo "Error: unable to download hwpack" >&2
47+ exit 1
48+ fi
49 fi
50
51 # chown hwpack for convenience

Subscribers

People subscribed via source and target branches