[csw-devel] SF.net SVN: opencsw:[362] gar-wrapper/mgar

skayser at users.sourceforge.net skayser at users.sourceforge.net
Wed Mar 16 01:07:54 CET 2011


Revision: 362
          http://opencsw.svn.sourceforge.net/opencsw/?rev=362&view=rev
Author:   skayser
Date:     2011-03-16 00:07:53 +0000 (Wed, 16 Mar 2011)

Log Message:
-----------
mgar: make show-buildsys fail gracefully on non-svn  copies

Modified Paths:
--------------
    gar-wrapper/mgar

Modified: gar-wrapper/mgar
===================================================================
--- gar-wrapper/mgar	2011-03-15 23:21:12 UTC (rev 361)
+++ gar-wrapper/mgar	2011-03-16 00:07:53 UTC (rev 362)
@@ -290,6 +290,18 @@
   svn commit "${__log_args[@]:-}" "$@"
 }
 
+function get_rev() {
+  local __file="$1"
+  ( svn info "$__file" || echo "Revision: unknown" ) | grep "Revision:" | \
+    cut -d: -f2- | tr -d " "
+}
+
+function get_repourl() {
+  local __file="$1"
+  ( svn info "$__file" || echo "URL: unknown" ) | grep ^URL: | \
+    cut -d: -f2- | tr -d " "
+}
+
 function get_srcdir() {
   $0 -f <( cat Makefile; echo -e '\nsrcdir:\n\t at echo $(WORKSRC_FIRSTMOD)' ) srcdir
 }
@@ -435,9 +447,9 @@
 # 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 }'`
-                   echo -e "$BUILDSYS\t($__rev, Branch: $__branch)"
+    show-buildsys) __rev=`get_rev "$BUILDSYS"`
+                   __branch=`get_repourl "$BUILDSYS" | sed -e "s,$GAR_REPO,,"`
+                   echo -e "$BUILDSYS\t(Revision: $__rev, Branch: $__branch)"
                    ;;
       show-srcdir) echo `get_srcdir`;;
     show-stagedir) echo `get_stagedir`;;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list