From 4d992643548afb652b6f0d170a445e9e5f8b231c Mon Sep 17 00:00:00 2001 From: Erich Cordoba Date: Tue, 3 Jul 2018 13:52:41 -0500 Subject: [PATCH] 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 --- README.md | 3 +-- toCOPY/generate-cgcs-centos-repo.sh | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2fb2b41c..a516038a 100644 --- a/README.md +++ b/README.md @@ -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. ``` -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. diff --git a/toCOPY/generate-cgcs-centos-repo.sh b/toCOPY/generate-cgcs-centos-repo.sh index 32de2b91..bc5587cc 100755 --- a/toCOPY/generate-cgcs-centos-repo.sh +++ b/toCOPY/generate-cgcs-centos-repo.sh @@ -45,13 +45,15 @@ for t in "Binary" "Source" ; do pushd "$mirror_dir/$t"|| exit 1 find . -type d -exec mkdir -p "${target_dir}"/{} \; + all_files=$(find . -type f -name "*") popd || exit 1 - all_files=$(find "$mirror_dir/$t" -type f -name "*") + for ff in $all_files; do f_name=$(basename "$ff") - ln -sf "$ff" "$target_dir/$f_name" - echo "Creating symlink for $target_dir/$f_name" + sub_dir=$(dirname "$ff") + ln -sf "$mirror_dir/$t/$ff" "$target_dir/$sub_dir" + echo "Creating symlink for $target_dir/$sub_dir/$f_name" echo "------------------------------" done done