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

skayser at users.sourceforge.net skayser at users.sourceforge.net
Mon Feb 21 15:18:27 CET 2011


Revision: 315
          http://opencsw.svn.sourceforge.net/opencsw/?rev=315&view=rev
Author:   skayser
Date:     2011-02-21 14:18:27 +0000 (Mon, 21 Feb 2011)

Log Message:
-----------
mgar: fix init handling by handling it as a special case that doesn't run through regular sanity checks

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

Modified: gar-wrapper/mgar
===================================================================
--- gar-wrapper/mgar	2011-02-21 14:02:24 UTC (rev 314)
+++ gar-wrapper/mgar	2011-02-21 14:18:27 UTC (rev 315)
@@ -108,7 +108,7 @@
 
 function init_buildtree {
   __buildtree="$1"
-  if [ -d "$__buildtree" ]; then
+  if [ -a "$__buildtree" ]; then
     echo "The directory $__buildtree already exists. Please remove it." >&2
     exit 2
   fi
@@ -282,12 +282,9 @@
 
 [ $# -eq 0 -o "${1:-}" == "help" -o "${1:-}" == "--help" ] && { usage; exit; }
 [ $1 == "-x" ] && { shift; set -x; }
+[ $1 == "init" ] && { init_buildtree ${2-$DEF_BUILDTREE}; exit; }
 
-# Unless we are going to "init", make sure that the build system is in place
-if [ "${1-}" != "init" ]; then
-  BUILDTREE="`read_config_value BUILDTREE`"; eval BUILDTREE="$BUILDTREE"
-fi
-
+BUILDTREE="`read_config_value BUILDTREE`"; eval BUILDTREE="$BUILDTREE"
 assert_multi_buildsys_tree "$BUILDTREE/.buildsys"
 
 # When we execute a non-global (i.e. pkg scope) command, assert that we are
@@ -304,7 +301,6 @@
 case $1 in
 
 # global-cmds
-             init) init_buildtree ${2-$DEF_BUILDTREE};;
             index) build_index "$BUILDTREE";;
            locate) shift; search_index "$BUILDTREE" "${1-}";;
      show-pkgtree) echo "$BUILDTREE";;


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