aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2015-07-29 15:35:33 +0000
committerLinaro Code Review <review@review.linaro.org>2015-07-29 15:35:33 +0000
commit17adc2d31e6ca966ee0888d16c367b07872b4604 (patch)
treeabf0c8b21868cd06da080c0bbce89f29d6b12dd9 /lib
parent87c01a7518a9005061684b4f3377cec0119f3246 (diff)
parent7763d559e48e5f56f346885c73446440995e73ef (diff)
Merge "lib/checkout.sh: Fix greedy checkout_infrastructure()."
Diffstat (limited to 'lib')
-rw-r--r--lib/checkout.sh36
1 files changed, 34 insertions, 2 deletions
diff --git a/lib/checkout.sh b/lib/checkout.sh
index 54ff68d2..76962a31 100644
--- a/lib/checkout.sh
+++ b/lib/checkout.sh
@@ -30,6 +30,7 @@ checkout_infrastructure()
trace "$*"
if test x"${supdate}" = xno; then
+ warning "checkout_infrastructure called with --disable update. Checkout of infrastructure files will be skipped."
return 0
fi
@@ -50,10 +51,41 @@ checkout_infrastructure()
# some libraries depend on other libraries being bult first. Egrep
# unfortunately sorts the files, which screws up the order.
local files="`grep ^latest= ${topdir}/config/dejagnu.conf | cut -d '\"' -f 2`"
+
+ local version=
for i in ${depends}; do
- files="${files} `grep /$i ${local_snapshots}/md5sums | cut -d ' ' -f3 | uniq`"
- done
+ case $i in
+ linux) version=${linux_version} ;;
+ mpfr) version=${mpfr_version} ;;
+ mpc) version=${mpc_version} ;;
+ gmp) version=${gmp_version} ;;
+ dejagnu) version=${dejagnu_version} ;;
+ *)
+ error "config/infrastructure.conf contains an unknown dependency: $i"
+ return 1
+ ;;
+ esac
+ # If the user didn't set it, check the <component>.conf files for
+ # 'latest'.
+ if test "${version:+set}" != "set"; then
+ version="`grep ^latest= ${topdir}/config/${i}.conf | cut -d '\"' -f 2`"
+ # Sometimes config/${i}.conf uses <component>-version and sometimes
+ # it just uses 'version'. Regardless, searching the md5sums file requires
+ # that we include the component name.
+ version=${i}-${version#${i}-}
+ fi
+
+ if test "${version:+found}" != "found"; then
+ error "Can't find a version for component \"$i\" in ${i}.conf"
+ return 1
+ fi
+
+ # Hopefully we only download the exact match for each one. Depending
+ # how vague the user is it might download multiple tarballs.
+ files="${files} `grep /${version} ${local_snapshots}/md5sums | cut -d ' ' -f3 | uniq`"
+ unset version
+ done
for i in ${files}; do
local name="`echo $i | sed -e 's:\.tar\..*::' -e 's:infrastructure/::' -e 's:testcode/::'`"