
This change improves support for organizational or personal local mirrors. Download tools work in a wider variety of environmnets, and the population of build environments is now driven by .lst files. The download_mirror.sh (and related files) now have options to better support running in non-containerized environments. This includes options to run using local yum.conf files (rather than system files) and not executing sudo or chgrp commands. These options are enabled by flags. Default behaviour remains unchanged. The generate-cgcs-centos-repo.sh tool now populates build environment as driven by lst files. This allows a mirror to be maintained (and grown) at an organizational level, while allowing a developer to produce exactly the environment they need as per the lst files they have checked out. generate-cgcs-centos-repo.sh now also populates the downloads directory by invoking the populate_downloads.sh script (also driven by lst files) Change-Id: I8aae32c776df7618a5ef545a0ce43903b41112d0 Story: 2003422 Task: 24586 Signed-off-by: jmckenna <jason.mckenna@windriver.com>
54 lines
1.5 KiB
Bash
Executable File
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.2.1.0.6.42120.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
|