Permalink
Browse files

check_package: handle when projects are not present or are not links

  • Loading branch information...
1 parent 198aaea commit 139ec2444f82049d2120d5f4996f353b7e218b57 @gregkh committed Dec 16, 2010
Showing with 18 additions and 7 deletions.
  1. +18 −7 check_package
View
@@ -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
}

0 comments on commit 139ec24

Please sign in to comment.