xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH OSSTEST] cri-common: Refactor select_prevxenbranch to cri-getprevxenbranch
@ 2015-09-11 10:06 Ian Campbell
  2015-09-11 14:38 ` Ian Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2015-09-11 10:06 UTC (permalink / raw)
  To: ian.jackson, xen-devel; +Cc: Ian Campbell

This moves it outside any prevailing set -x and reduces the amount of
noise in various logs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 cri-common           | 16 +---------------
 cri-getprevxenbranch | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 15 deletions(-)
 create mode 100755 cri-getprevxenbranch

diff --git a/cri-common b/cri-common
index 94696ab..2669485 100644
--- a/cri-common
+++ b/cri-common
@@ -61,21 +61,7 @@ repo_tree_rev_fetch_git () {
 }
 
 select_prevxenbranch () {
-	local b
-	local p
-	for b in $(./mg-list-all-branches) ; do # already sorted by version
-		case "$b" in
-		xen*)
-			if [ "x$b" = "x$xenbranch" ] ; then
-				break
-			else
-				p=$b
-			fi
-			;;
-		*)	;;
-		esac
-	done
-	prevxenbranch=$p
+	prevxenbranch=`./cri-getprevxenbranch $xenbranch`
 }
 
 select_xenbranch () {
diff --git a/cri-getprevxenbranch b/cri-getprevxenbranch
new file mode 100755
index 0000000..dce52c2
--- /dev/null
+++ b/cri-getprevxenbranch
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+xenbranch=$1
+p=
+
+for b in $(./mg-list-all-branches) ; do # already sorted by version
+    case "$b" in
+	xen*)
+	    if [ "x$b" = "x$xenbranch" ] ; then
+		break
+	    else
+		p=$b
+	    fi
+	    ;;
+	*)	;;
+    esac
+done
+
+echo $p
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-11 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 10:06 [PATCH OSSTEST] cri-common: Refactor select_prevxenbranch to cri-getprevxenbranch Ian Campbell
2015-09-11 14:38 ` Ian Jackson
2015-09-11 14:52   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).