From 655e9ec04fb1497802a4b894ab07a61c0ee30b6f Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: May 14 2018 19:23:31 +0000 Subject: Allow do-rebase to pull the patches from different repositories Currently the script always pull the patches from rhboot Github repo, but for testing and developing purposes may be useful to use a different one. Signed-off-by: Javier Martinez Canillas --- diff --git a/do-rebase b/do-rebase index ec68118..7fdae45 100755 --- a/do-rebase +++ b/do-rebase @@ -17,7 +17,7 @@ usage() exec 1>&2 retcode=$1 fi - echo usage: do-rebase \$releasever + echo usage: do-rebase \$releasever \$gitrepo exit $retcode } @@ -26,6 +26,7 @@ if ! git status | grep -q 'nothing to commit, working .* clean' ; then exit 1 fi +gitrepo="git@github.com:rhboot/grub2.git" releasever="" amend="" @@ -43,6 +44,13 @@ while [ $# -gt 0 ]; do shift releasever=$1 ;; + --repo=*) + gitrepo=${1##--repo=} + ;; + --repo) + shift + gitrepo=$1 + ;; --amend) amend="--amend" ;; @@ -88,6 +96,11 @@ if [ -z "$releasever" ]; then usage 1 fi +if [ -n "${1:-}" ]; then + gitrepo=$1 + shift +fi + if [ $# -ge 1 ]; then echo "Unknown argument \"$1\"" 1>&2 usage 1 @@ -96,14 +109,14 @@ fi if [ ! -d $PWD/.rhboot.git ]; then othergit init if ! othergit remote add \ - rhboot git@github.com:rhboot/grub2.git \ + rhboot $gitrepo \ >/dev/null 2>&1 ; then echo "Could not add remote: rhboot" 1>&2 exit 1 fi elif othergit remote show -n rhboot | grep -q "URL: github$" ; then if ! othergit remote add \ - rhboot git@github.com:rhboot/grub2.git \ + rhboot $gitrepo \ >/dev/null 2>&1 ; then echo "Could not add remote: rhboot" 1>&2 exit 1