Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check_package*: support overriding osc API

This happens via -A on the osc level and via --api on the
check_package* level.
  • Loading branch information...
commit 05f9652573839fb8f6aa1afe6aa4edd7af7eb1d8 1 parent 9af89e0
Jiri Slaby authored
Showing with 19 additions and 9 deletions.
  1. +13 −8 check_package
  2. +6 −1 check_packages
View
21 check_package
@@ -18,6 +18,8 @@
# Greg Kroah-Hartman <gregkh@suse.de>
#
+OSC_API="https://api.opensuse.org"
+
# Main Tumbleweed repository location
TUMBLE_REPO="openSUSE:Tumbleweed"
@@ -33,8 +35,8 @@ LIBREOFFICE_REPO="openSUSE:Tumbleweed:Libreoffice"
# $REPO to be set to the base repo name
compare_version() {
-# BASE_LINK=`osc log --csv $REPO/$PACKAGE 2> /dev/null | head -n 1 | cut -f 4 -d '|'`
- BASE_LINK=`osc api /source/${REPO}/${PACKAGE}?expand=1 | sed -n 's@^.*directory.*srcmd5="\([0-9a-f]*\)".*$@\1@ p'`
+# BASE_LINK=`osc -A "$OSC_API" log --csv $REPO/$PACKAGE 2> /dev/null | head -n 1 | cut -f 4 -d '|'`
+ BASE_LINK=`osc -A "$OSC_API" api /source/${REPO}/${PACKAGE}?expand=1 | sed -n 's@^.*directory.*srcmd5="\([0-9a-f]*\)".*$@\1@ p'`
#echo $BASE_LINK
if [ "$BASE_LINK" = "" ]
@@ -43,16 +45,16 @@ compare_version() {
exit 1
fi
- #TUMBLE_LINK=`osc cat $TUMBLE_REPO/$PACKAGE/_link 2> /dev/null | grep rev | cut -f 4 -d ' ' | cut -f 2 -d '=' | cut -f 1 -d '=' | sed -e 's/\"//g'`
- TUMBLE_LINK=`osc cat $TUMBLE_REPO/$PACKAGE/_link 2> /dev/null | sed -n 's@^.*package.*rev="\([0-9a-f]*\)".*$@\1@ p'`
+ #TUMBLE_LINK=`osc -A "$OSC_API" cat $TUMBLE_REPO/$PACKAGE/_link 2> /dev/null | grep rev | cut -f 4 -d ' ' | cut -f 2 -d '=' | cut -f 1 -d '=' | sed -e 's/\"//g'`
+ TUMBLE_LINK=`osc -A "$OSC_API" cat $TUMBLE_REPO/$PACKAGE/_link 2> /dev/null | sed -n 's@^.*package.*rev="\([0-9a-f]*\)".*$@\1@ p'`
#echo $TUMBLE_LINK
if [ "$TUMBLE_LINK" = "" ]
then
- EXIST=`osc ls $TUMBLE_REPO | grep "^${PACKAGE}$"`
+ EXIST=`osc -A "$OSC_API" ls $TUMBLE_REPO | grep "^${PACKAGE}$"`
if [ "$EXIST" = "" ]
then
echo "# $PACKAGE is not in $TUMBLE_REPO, add it by doing:"
- echo "osc linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
+ echo "osc -A "$OSC_API" linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
else
echo "# $PACKAGE is not a linked package in $TUMBLE_REPO, to overwrite the link, do:"
fi
@@ -62,8 +64,8 @@ compare_version() {
then
echo "# $PACKAGE is up to date."
else
- #echo "osc linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
- echo "osc setlinkrev -r $BASE_LINK $TUMBLE_REPO $PACKAGE"
+ #echo "osc -A "$OSC_API" linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
+ echo "osc -A "$OSC_API" setlinkrev -r $BASE_LINK $TUMBLE_REPO $PACKAGE"
fi
}
@@ -90,6 +92,9 @@ while [ "$1" != "" ]; do
;;
--libreoffice ) TUMBLE_REPO=$LIBREOFFICE_REPO
;;
+ --api ) shift
+ OSC_API="$1"
+ ;;
* ) FULL_PACKAGE=$1
;;
esac
View
7 check_packages
@@ -20,6 +20,8 @@
# --testing : openSUSE:Tumbleweed:Testing
# --repo : You pick the repo to use
+OSC_API=""
+
# Default package list filename. Override it on the command line
# if you want something else
FILE="package_list"
@@ -42,6 +44,9 @@ while [ "$1" != "" ]; do
--repo ) shift
REPO=$1
;;
+ --api ) shift
+ OSC_API="--api $1"
+ ;;
* ) FILE=$1
;;
esac
@@ -59,6 +64,6 @@ do
fi
if [ "$line" != "" ]
then
- ./check_package --repo $REPO $line
+ ./check_package $OSC_API --repo $REPO $line
fi
done < $FILE
Please sign in to comment.
Something went wrong with that request. Please try again.