Fix wrong link formation

There was a bug in the formation of the symlink that doesn't
create the correct folder structure.

Change-Id: I4d0215dc0f1c31588f337323a336c1ac4b70f651
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This commit is contained in:
Erich Cordoba 2018-07-03 13:52:41 -05:00
parent 9a164a6adb
commit 4d99264354
2 changed files with 6 additions and 5 deletions

View File

@ -181,8 +181,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