aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan S. Arnold <ryan.arnold@linaro.org>2015-07-28 15:29:21 -0500
committerRyan S. Arnold <ryan.arnold@linaro.org>2015-07-28 19:06:51 -0500
commit7763d559e48e5f56f346885c73446440995e73ef (patch)
tree9a171c72cc9381ce7f02e706b5fe9698ca7de7af /lib
parentfd43bcc8ff45238368915336b22cbf473cae5c71 (diff)
lib/checkout.sh: Fix greedy checkout_infrastructure().
The checkout_infrastructure() function was checking out every file from md5sums that matched the 'depends' component name. This fix makes sure to use the configs/<component>.conf file (or the user's <component>=<version> command line) for the full component version or name. Change-Id: I302fa96052bef23d56d65054c6368e8a19416306
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/::'`"