Skip to content

Commit

Permalink
Add repos with -n argument to replace default messy names
Browse files Browse the repository at this point in the history
  • Loading branch information
simoniz0r committed Apr 5, 2018
1 parent 84e7f19 commit d43c480
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions osc-easy-install
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ else
echo "$SELECTION_NUMBER"
PROJECT_NAME="$(sed -n ${SELECTION_NUMBER}p /tmp/oeisearchcache)"
BINARY_VERSION="$(echo $PROJECT_NAME | rev | cut -f1 -d'/' | rev)"
SUSE_RELEASE="$(echo $PROJECT_NAME | rev | cut -f3 -d'/' | rev)"
REPO_RELEASE="$(echo $PROJECT_NAME | rev | cut -f3 -d'/' | rev | cut -f2 -d'_')"
REPO_NAME="$(echo $PROJECT_NAME | rev | cut -f4- -d'/' | rev | tr -d '/' | tr ':' '_')"
PROJECT_REPO="$(echo $PROJECT_NAME | rev | cut -f3- -d'/' | rev)"
PROJECT_NAME="$(echo $PROJECT_NAME | rev | cut -f4- -d'/' | rev | tr -d '/')"
REPO_URL="http://download.opensuse.org/repositories/$PROJECT_REPO/"
Expand Down Expand Up @@ -182,7 +183,7 @@ case $? in
HALF_WIDTH=$(echo $CURRENT_WIDTH | awk '{print $1 * .40}')
HALF_HEIGHT=$(echo $CURRENT_HEIGHT | awk '{print $1 * .40}')
if ! zypper lr -U | grep -qm1 "$REPO_URL"; then
xterm -geometry 90x30+${HALF_WIDTH}+${HALF_HEIGHT} -e "sudo zypper addrepo -f -p 100 ${REPO_URL}/${PROJECT_NAME}.repo && sudo zypper refresh && sudo zypper install $BINARY_VERSION"
xterm -geometry 90x30+${HALF_WIDTH}+${HALF_HEIGHT} -e "sudo zypper addrepo -f -p 100 -n "$REPO_NAME/$REPO_RELEASE" ${REPO_URL}/${PROJECT_NAME}.repo && sudo zypper refresh && sudo zypper install $BINARY_VERSION"
else
xterm -geometry 90x30+${HALF_WIDTH}+${HALF_HEIGHT} -e "sudo zypper refresh && sudo zypper install $BINARY_VERSION"
fi
Expand Down

0 comments on commit d43c480

Please sign in to comment.