diff mbox

[maintainer-tools,RFC,16/17] dim: abstract dim_for_each_workdirs

Message ID a09916c2fbdeb71b7f685f2593bbf6ce00afe99f.1453818220.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Jan. 26, 2016, 2:32 p.m. UTC
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 dim | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/dim b/dim
index 26ab728efb16..1f51ab9292b1 100755
--- a/dim
+++ b/dim
@@ -587,6 +587,18 @@  function dim_create_workdir
 	done
 }
 
+function dim_for_each_workdirs
+{
+	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	$@
+	for branch in $dim_branches ; do
+		if [[ -d $DIM_PREFIX/$branch ]] ; then
+			cd $DIM_PREFIX/$branch
+			$@
+		fi
+	done
+}
+
 # dim_pull_request branch upstream
 function dim_pull_request
 {
@@ -787,16 +799,6 @@  fi
 # XXX: abscract each case to a dim_ prefixed function, and turn the help|*) case
 # into an else branch in the above check for functions.
 case "$subcmd" in
-	for-each-workdirs)
-		cd $DIM_PREFIX/$DIM_DRM_INTEL
-		$@
-		for branch in $dim_branches ; do
-			if [[ -d $DIM_PREFIX/$branch ]] ; then
-				cd $DIM_PREFIX/$branch
-				$@
-			fi
-		done
-		;;
 	cat-to-fixup)
 		cd $DIM_PREFIX/drm-intel-nightly
 		cat > `cat .fixup_file_path`