Skip to content

Commit

Permalink
Change add repo during OBS install to use obs://project URL
Browse files Browse the repository at this point in the history
  • Loading branch information
simoniz0r committed Mar 30, 2019
1 parent e668b6c commit d392569
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zyp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ installobs() {
N|n|No|no) echo "$(tput setaf $COLOR_INFO)Nothing to do.$(tput sgr0)"; exit 0;;
esac
REPO_URL="http://download.opensuse.org/repositories/$(echo "$PKG_PROJECT" | sed 's%:%:\/%g')/$(echo "$PKG_REPO" | sed 's%:%:\/%g')/"
FULL_REPO_URL="https://download.opensuse.org/repositories/$PKG_PROJECT/$PKG_REPO/$PKG_PROJECT.repo"
OBS_REPO_URL="obs://$PKG_PROJECT"
REPO_NAME="$(echo $PKG_PROJECT | tr ':' '_')"
# detect if user already has repo added
if zypper -x lr | xmlstarlet sel -t -v "/stream/repo-list/repo/url" -n | grep -qm1 "$REPO_URL"; then
Expand All @@ -253,7 +253,7 @@ installobs() {
else
SKIP_REPOREM="FALSE"
echo "$(tput setaf $COLOR_INFO)Adding '$REPO_NAME' to list of repositories...$(tput sgr0)"
sudo zypper ar -f -p 100 -n "$REPO_NAME/$PKG_REPO" "$FULL_REPO_URL"
sudo zypper ar -f -p 100 -n "$REPO_NAME/$PKG_REPO" "$OBS_REPO_URL" "$REPO_NAME"
local ZYPPER_EXIT=$?
case $ZYPPER_EXIT in
# if repo added, do nothing
Expand All @@ -267,7 +267,7 @@ installobs() {
esac
fi
# refresh to make sure user is prompted to trust repo
sudo zypper ref
sudo zypper ref "$REPO_NAME"
echo "$(tput setaf $COLOR_INFO)Installing '$PKG_NAME' from repo '$REPO_NAME'..."
# install package from repo
sudo zypper --no-refresh in --from "$REPO_NAME" "$PKG_NAME"
Expand Down

0 comments on commit d392569

Please sign in to comment.