[csw-devel] [PATCH] mgar: support show-buildsys outside Subversion

Maciej Blizinski maciej at opencsw.org
Sat Mar 5 10:58:28 CET 2011


Subversion might not always be available.  If it isn't mgar should not crash.
---
 gar-wrapper/mgar |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gar-wrapper/mgar b/gar-wrapper/mgar
index acf48db..5a9adb3 100755
--- a/gar-wrapper/mgar
+++ b/gar-wrapper/mgar
@@ -423,8 +423,8 @@ case $1 in
 # per-pkg-cmds
         edit-file) $EDITOR `gfind \`get_srcdir\` -name "$2"`;;
         find-file) gfind "`get_srcdir`" -name "$2";;
-    show-buildsys) __rev="`svn info "$BUILDSYS" | grep ^Revision:`"
-                   __branch=`svn info "$BUILDSYS" | grep ^URL: | awk -F/ '{ print $(NF-1)"/"$NF }'`
+    show-buildsys) __rev="$( ( svn info "$BUILDSYS" || echo "Revision: unknown" ) | grep ^Revision:)"
+                   __branch=$( ( svn info "$BUILDSYS" || echo "URL: unknown" ) | grep ^URL: | awk -F/ '{ print $(NF-1)"/"$NF }')
                    echo -e "$BUILDSYS\t($__rev, Branch: $__branch)"
                    ;;
       show-srcdir) echo `get_srcdir`;;
-- 
1.7.3.2



More information about the devel mailing list