tools/toCOPY/populate_downloads.sh
Jason McKenna e3712f2741 Update populate_downloads to use latest libibverbs
An update to stx-integ (https://review.openstack.org/#/c/591936/)
upreved the version of libibverbs that the build was expecting.
This change uprevs the version which is placed in downloads/ by
populate_downloads.sh to match the expected version.

Change-Id: I5ab727f373fe4c73b73135e6860beb99792537d6
Signed-off-by: jmckenna <jason.mckenna@windriver.com>
Story: 2003508
Task: 24786
2018-08-21 09:14:00 -04:00

54 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
#
# SPDX-License-Identifier: Apache-2.0
#
usage () {
echo "$0 <mirror-path>"
}
if [ $# -ne 1 ]; then
usage
exit -1
fi
if [ -z "$MY_REPO" ]; then
echo "\$MY_REPO is not set. Ensure you are running this script"
echo "from the container and \$MY_REPO points to the root of"
echo "your folder tree."
exit -1
fi
mirror_dir=$1
tarball_lst=${MY_REPO_ROOT_DIR}/stx-tools/centos-mirror-tools/tarball-dl.lst
downloads_dir=${MY_REPO}/stx/downloads
extra_downloads="mlnx-ofa_kernel-4.3-OFED.4.3.3.0.2.1.gcf60532.src.rpm libibverbs-41mlnx1-OFED.4.3.2.1.6.43302.src.rpm rdma-core-43mlnx1-1.43302.src.rpm"
mkdir -p ${MY_REPO}/stx/downloads
grep -v "^#" ${tarball_lst} | while read x; do
if [ -z "$x" ]; then
continue
fi
# Get first element of item & strip leading ! if appropriate
tarball_file=$(echo $x | sed "s/#.*//" | sed "s/^!//")
# put the file in downloads
source_file=$(find ${mirror_dir}/downloads -name "${tarball_file}")
if [ -z ${source_file} ]; then
echo "Could not find ${tarball_file}"
else
rel_path=$(echo ${source_file} | sed "s%^${mirror_dir}/downloads/%%")
rel_dir_name=$(dirname ${rel_path})
if [ ! -e ${downloads_dir}/${rel_dir_name}/${tarball_file} ]; then
mkdir -p ${downloads_dir}/${rel_dir_name}
ln -sf ${source_file} ${downloads_dir}/${rel_dir_name}/
fi
fi
done
for x in ${extra_downloads}; do
ln -sf ${mirror_dir}/downloads/$x ${downloads_dir}
done