Merge "Fix wrong link formation"

This commit is contained in:
Zuul 2018-07-10 04:57:45 +00:00 committed by Gerrit Code Review
commit c8c8800d0e
2 changed files with 6 additions and 5 deletions

View File

@ -179,8 +179,7 @@ and the mock configuration file. It is needed to create these links if this is
the first build or the mirror has been updated. the first build or the mirror has been updated.
``` ```
cd $MY_REPO_ROOT_DIR/stx-tools/scripts generate-cgcs-centos-repo.sh /import/mirror/CentOS/pike
./generate-cgcs-centos-repo.sh /import/mirror/CentOS/pike
``` ```
Where the argument to the script is the path of the mirror. Where the argument to the script is the path of the mirror.

View File

@ -45,13 +45,15 @@ for t in "Binary" "Source" ; do
pushd "$mirror_dir/$t"|| exit 1 pushd "$mirror_dir/$t"|| exit 1
find . -type d -exec mkdir -p "${target_dir}"/{} \; find . -type d -exec mkdir -p "${target_dir}"/{} \;
all_files=$(find . -type f -name "*")
popd || exit 1 popd || exit 1
all_files=$(find "$mirror_dir/$t" -type f -name "*")
for ff in $all_files; do for ff in $all_files; do
f_name=$(basename "$ff") f_name=$(basename "$ff")
ln -sf "$ff" "$target_dir/$f_name" sub_dir=$(dirname "$ff")
echo "Creating symlink for $target_dir/$f_name" ln -sf "$mirror_dir/$t/$ff" "$target_dir/$sub_dir"
echo "Creating symlink for $target_dir/$sub_dir/$f_name"
echo "------------------------------" echo "------------------------------"
done done
done done