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

skayser at users.sourceforge.net skayser at users.sourceforge.net
Wed Mar 16 01:49:50 CET 2011


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

Log Message:
-----------
mgar: add newpkg-* to the recognized global commands

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

Modified: gar-wrapper/mgar
===================================================================
--- gar-wrapper/mgar	2011-03-16 00:08:37 UTC (rev 363)
+++ gar-wrapper/mgar	2011-03-16 00:49:49 UTC (rev 364)
@@ -35,6 +35,9 @@
 # * Add template for ~/.garrc (think new users)
 # * Integrate the creation of a new package (with sanity check whether
 #   package already exists). Use per-directory Makefile.template files.
+#   Example:
+#     mgar newpkg foo (picks up Makefile.tmpl)
+#     mgar newpkg --documented foo (picks up Makefile.tmpl-documented)
 # * When packaging mgar, shield mgar up --self so that it won't override
 #   the package binary, but place it somewhere else.
 # * In commit mode, if (pwd.endswith('trunk') and svn.rev -eq 0) commit ..
@@ -165,8 +168,12 @@
   __global_cmds=`sed -ne '/^# global-cmds/,/^# \/global-cmds/p' $0 | \
     ggrep -E '^\s*[^)]+\) ' | cut -d\) -f1 | tr '|' '\n'`
 
+  # Use a case construct to also match wildcard items from the global
+  # command list (e.g. newpkg-foo should match newpkg-* from the list)
   while read cmd; do
-    [ "$cmd" == "$1" ] && return 1
+    case $1 in
+      $cmd) return 1;;
+    esac
   done < <( echo "$__global_cmds" )
 
   return 0
@@ -424,6 +431,7 @@
 # global-cmds
             index) build_index "$BUILDTREE";;
            locate) shift; search_index "$BUILDTREE" "${1-}";;
+         newpkg-*) gmake "$@";; # temporary, should be replaced, see TODO
      show-pkgtree) echo "$BUILDTREE";;
         commit|ci) shift; verify_local_status_and_commit "$@";;
               scm) shift; svn $@;;


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