[yast-commit] r66187 - /trunk/devtools/devtools/bin/obssync
Author: visnov Date: Fri Sep 30 12:25:31 2011 New Revision: 66187 URL: http://svn.opensuse.org/viewcvs/yast?rev=66187&view=rev Log: Added y2tool obssync tool - to sync all changed packages from YaST:Head to other projects, typically openSUSE:Factory Added: trunk/devtools/devtools/bin/obssync (with props) Added: trunk/devtools/devtools/bin/obssync URL: http://svn.opensuse.org/viewcvs/yast/trunk/devtools/devtools/bin/obssync?rev=66187&view=auto ============================================================================== --- trunk/devtools/devtools/bin/obssync (added) +++ trunk/devtools/devtools/bin/obssync Fri Sep 30 12:25:31 2011 @@ -0,0 +1,84 @@ +#!/bin/bash + +##### +#Usage: +# obssync [<OBS_Project>] +# +##### + +printhelp() +{ + echo "Usage: $0 <target-project>" + echo + echo "Synchronize changes from YaST:Head to target project. To synchronize with factory, use" + echo " $0 openSUSE:Factory" + echo + echo "OPTIONS:" + echo " -h, --help this message" + echo " -a, --api OBS API server" +} + +APIHOST=api.opensuse.org +TARGET_PROJECT="" + +# parse parameters +TEMP=`/usr/bin/getopt -o ha: --long help,api: \ + -n 'obssync' -- "$@"` + +# Note the quotes around `$TEMP': they are essential! +eval set -- "$TEMP" + +while true ; do + case "$1" in + -h|--help) printhelp; exit 0 ;; + -a|--api) APIHOST=$2; shift 2 ;; + --) shift ; TARGET_PROJECT=$1 ; break;; + *) echo "Unrecognized option $1" ; exit 1 ;; + # IMPORTANT: Remember to change that "getopt" call above, too + # if you change anything here! + esac +done + +if [ -z "$TARGET_PROJECT" ]; then + echo "Target project missing" + exit 1 +fi + +DEVEL_PROJECT="YaST:Head" +MESSAGE="Sync packages from YaST:Head devel project to $TARGET_PROJECT (using $APIHOST)" + +echo $MESSAGE +echo "Generating list of candidates..." + +PACKAGES=`osc -A https://$APIHOST list $DEVEL_PROJECT` + +TO_SUBMIT="" + +for package in $PACKAGES; do + + osc -A https://$APIHOST rdiff $DEVEL_PROJECT $package $TARGET_PROJECT | grep \\.changes + + if [ $? -eq 0 ]; then + echo "Changes in $package" + TO_SUBMIT="$TO_SUBMIT $package" + else + echo "Skipping $package" + fi + +done + +echo "Summary:" +echo "========" +echo "$TO_SUBMIT" +echo + +echo -n "Press ENTER to continue" + +read + +for package in $TO_SUBMIT; do + echo -n "$package: " + osc -A https://$APIHOST sr -m "$MESSAGE" $DEVEL_PROJECT $package $TARGET_PROJECT +done + +echo "Done" -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
visnov@svn2.opensuse.org