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