Skip to content

Commit

Permalink
check_package: handle when projects are not present or are not links
Browse files Browse the repository at this point in the history
  • Loading branch information
gregkh committed Dec 16, 2010
1 parent 198aaea commit 139ec24
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions check_package
Expand Up @@ -27,22 +27,33 @@ TUMBLE_REPO="openSUSE:Tumbleweed"
# $REPO to be set to the base repo name
compare_version() {

EXISTING=`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'`
#echo $EXISTING
BASE_LINK=`osc log --csv $REPO/$PACKAGE 2> /dev/null | head -n 1 | cut -f 4 -d '|'`
#echo $BASE_LINK

NEW=`osc log --csv $REPO/$PACKAGE 2> /dev/null | head -n 1 | cut -f 4 -d '|'`
#echo $NEW
if [ "$BASE_LINK" = "" ]
then
echo "There is no such package as $REPO/$PACKAGE."
exit 1
fi

if [ "$EXISTING" = "" ]
EXIST=`osc ls $TUMBLE_REPO | grep $PACKAGE`
if [ "$EXIST" = "" ]
then
echo "# $PACKAGE is not in Tumbleweed, add it by doing:"
else
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'`
#echo $TUMBLE_LINK
if [ "$TUMBLE_LINK" = "" ]
then
echo "# $PACKAGE is not a linked package in Tumbleweed, to overwrite the link, do:"
fi
fi

if [ "$NEW" = "$EXISTING" ]
if [ "$BASE_LINK" = "$TUMBLE_LINK" ]
then
echo "# $PACKAGE is up to date."
else
echo "osc linkpac -f -r $NEW $REPO $PACKAGE $TUMBLE_REPO"
echo "osc linkpac -f -r $BASE_LINK $REPO $PACKAGE $TUMBLE_REPO"
fi
}

Expand Down

0 comments on commit 139ec24

Please sign in to comment.