fix(rpm-ostree): Same-named repos are overwrited instead of being downloaded separately
This commit is contained in:
parent
8922f025b6
commit
68d93e907e
1 changed files with 6 additions and 1 deletions
|
|
@ -9,8 +9,13 @@ if [[ ${#REPOS[@]} -gt 0 ]]; then
|
|||
echo "Adding repositories"
|
||||
for REPO in "${REPOS[@]}"; do
|
||||
REPO="${REPO//%OS_VERSION%/${OS_VERSION}}"
|
||||
if [[ "${REPO}" =~ ^https?:\/\/.* ]]; then
|
||||
# If it's the COPR repo, then download the repo normally
|
||||
# If it's not, then download the repo with URL in it's filename, to avoid duplicate repo name issue
|
||||
if [[ "${REPO}" =~ ^https?:\/\/.* ]] && [[ "${REPO}" == "https://copr.fedorainfracloud.org/coprs/"* ]]; then
|
||||
curl --output-dir "/etc/yum.repos.d/" -O "${REPO//[$'\t\r\n ']}"
|
||||
elif [[ "${REPO}" =~ ^https?:\/\/.* ]] && [[ "${REPO}" != "https://copr.fedorainfracloud.org/coprs/"* ]]; then
|
||||
CLEAN_REPO_NAME=$(echo "${REPO}" | sed 's/^https\?:\/\///')
|
||||
curl -o "/etc/yum.repos.d/${CLEAN_REPO_NAME//\//.}" "${REPO//[$'\t\r\n ']}"
|
||||
elif [[ ! "${REPO}" =~ ^https?:\/\/.* ]] && [[ "${REPO}" == *".repo" ]] && [[ -f "${CONFIG_DIRECTORY}/rpm-ostree/${REPO}" ]]; then
|
||||
cp "${CONFIG_DIRECTORY}/rpm-ostree/${REPO}" "/etc/yum.repos.d/${REPO##*/}"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue