Permalink
Browse files

check_package: use the source link instead for packages

This should fix the problem when the original package changes, which
breaks the link to what we have in our repo, causing build errors and
rebuilds unexpectedly.  Well, that's the goal at least...
  • Loading branch information...
1 parent 054941e commit bc291bf1b07f65fb44ac75ebc029c285764eae9f @gregkh committed Jan 11, 2012
Showing with 8 additions and 9 deletions.
  1. +8 −9 check_package
View
@@ -32,28 +32,26 @@ XFCE_REPO="openSUSE:Tumbleweed:xfce"
# $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 '|'`
-
-# osc api $REPO/$PACKAGE | grep link...
-#echo $BASE_LINK
+# 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'`
+ #echo $BASE_LINK
if [ "$BASE_LINK" = "" ]
then
echo "# There is no such package as $REPO/$PACKAGE."
exit 1
fi
-#osc api /source/X11:xfce/midori | grep linkinfo | grep xsrcmd5
-
-
- 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 | 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'`
#echo $TUMBLE_LINK
if [ "$TUMBLE_LINK" = "" ]
then
EXIST=`osc 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"
else
echo "# $PACKAGE is not a linked package in $TUMBLE_REPO, to overwrite the link, do:"
fi
@@ -63,7 +61,8 @@ compare_version() {
then
echo "# $PACKAGE is up to date."
else
- echo "osc linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
+ #echo "osc linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
+ echo "osc setlinkrev -r $BASE_LINK $TUMBLE_REPO $PACKAGE"
fi
}

0 comments on commit bc291bf

Please sign in to comment.