Index: /trunk/psconfig/mkbuild
===================================================================
--- /trunk/psconfig/mkbuild	(revision 11738)
+++ /trunk/psconfig/mkbuild	(revision 11739)
@@ -76,13 +76,7 @@
     $psperlbuild = `csh psconfig.sh --psperlbuild $version`;
 
-    # alias  psconfigure configure --prefix={$PSCONFDIR}/{$PSCONFIG} --bindir=$bindir --libdir=$libdir --includedir={$PSCONFDIR}/{$PSCONFIG}/include --sysconfdir={$PSCONFDIR}/{$PSCONFIG}/etc --datadir={$PSCONFDIR}/share --mandir={$PSCONFDIR}/man
-    # alias  psautogen autogen.sh --bindir=$bindir --libdir=$libdir --mandir=$mandir --includedir={$PSCONFDIR}/{$PSCONFIG}/include --sysconfdir={$PSCONFDIR}/{$PSCONFIG}/etc --datadir={$PSCONFDIR}/share
-    # alias  psperlbuild perl Build.PL --prefix {$PSCONFDIR}/{$PSCONFIG} --install_path script=$bindir --install_path arch=$bindir --install_path bin=$bindir --install_path lib=$libdir --install_path bindoc={$PSCONFDIR}/man/man1 --install_path libdoc={$PSCONFDIR}/man/man3
-
     print "psconfigure: $psconfigure\n";
     print "psautogen: $psautogen\n";
     print "psperlbuild: $psperlbuild\n";
-
-    exit 1;
 
     $psopts = "";
@@ -107,16 +101,15 @@
 	# - perl Build.PL : ./Build : ./Build install
  
-	if (-e Build.PL) {
+	if (-e "Build.PL") {
 	    print $PERL5LIB;
 
-	    # psperlbuild;
-	    # perl Build.PL --install_path script=$bindir --install_path lib=$libdir --install_path bindoc={$PSCONFDIR}/man/man1 --install_path libdoc={$PSCONFDIR}/man/man3
-	    if ($?) { &failure(); }
-
-	    # ./Build
-	    if ($?) { &failure(); }
-
-	    # ./Build install
-	    if ($?) { &failure(); }
+	    vsystem ("$psperlbuild");
+	    if ($?) { &failure($cvsname[$i], "failure in perl Build.PL"); }
+
+	    vsystem ("./Build");
+	    if ($?) { &failure($cvsname[$i], "failure in Build"); }
+
+	    vsystem ("./Build install");
+	    if ($?) { &failure($cvsname[$i], "failure in Build install"); }
 	    
 	    next;
@@ -124,40 +117,37 @@
 
 	if ($rebuild && $clean) {
-	    if (-e configure) { unlink "Makefile"; }
-	    if (-e configure.ac && -e autogen.sh) { unlink "configure"; }
+	    if (-e "configure") { unlink "Makefile"; }
+	    if (-e "configure.ac" && -e "autogen.sh") { unlink "configure"; }
 	}
 	$rebuild_this = $rebuild;
 
 	# set a local variable for this loop on rebuild;
-	if (! -e Makefile) { $rebuild_this = 1; }
+	if (! -e "Makefile") { $rebuild_this = 1; }
 
 	#  run autogen
 	$skip_configure = 0;
-	if ($rebuild_this && ! -e configure && -e autogen.sh) {
+	if ($rebuild_this && ! -e "configure" && -e "autogen.sh") {
 	    $skip_configure = 1;
-	    print "psautogen $psopts\n";
-	    vsystem ("psautogen $psopts");
-	    if ($?) { &failure(); }
-	}
-
-	if ($rebuild_this && -e configure && !$skip_configure) {
-	    print "psconfigure $psopts\n";
-	    vsystem ("psconfigure $psopts");
-	    if ($?) { &failure(); }
-	}
-
-	if (! -e Makefile) { &failure(); }
+	    vsystem ("$psautogen $psopts");
+	    if ($?) { &failure($cvsname[$i], "failure in psautogen"); }
+	}
+
+	if ($rebuild_this && -e "configure" && !$skip_configure) {
+	    vsystem ("$psconfigure $psopts");
+	    if ($?) { &failure($cvsname[$i], "failure in psconfigure"); }
+	}
+
+	if (! -e "Makefile") { &failure($cvsname[$i], "missing makefile"); }
 
 	if ($clean) { 
-	    print "make clean\n";
 	    vsystem ("make clean");
-	    if ($?) { &failure(); }
+	    if ($?) { &failure($cvsname[$i], "failure in make clean"); }
 	}
 
 	vsystem ("make");
-	if ($?) { &failure(); }
+	if ($?) { &failure($cvsname[$i], "failure in make"); }
 
 	vsystem ("make install");
-	if ($?) { &failure(); }
+	if ($?) { &failure($cvsname[$i], "failure in make install"); }
 
       success:
@@ -171,11 +161,9 @@
 sub vsystem {
     print STDERR "@_\n";
-    #$status = system ("@_");
-    #$status;
+    $status = system ("@_");
+    $status;
 }
 
 sub list_distributions {
-
-
     vsystem ("ls $tagsets/*.dst");
     exit 2;
@@ -210,6 +198,6 @@
 	if (($do_update ne "Y") && ($do_update ne "N")) { die "invalid tag option $do_update\n"; }
 	
-	print "module: $cvsname, branchtag: $branchtag, branchver: $branchver "; 
-	print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update\n";
+	print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update ";
+	print "module: $cvsname, branchtag: $branchtag, branchver: $branchver \n"; 
 
 	push @mode, $mode;
@@ -218,4 +206,8 @@
 	push @branchver, $branchver;
     }
+}
+
+sub failure {
+    die "problem building $_[0] : $_[1]\n";
 }
 
Index: /trunk/psconfig/psconfig.sh
===================================================================
--- /trunk/psconfig/psconfig.sh	(revision 11738)
+++ /trunk/psconfig/psconfig.sh	(revision 11739)
@@ -2,70 +2,57 @@
 # this file is sourced using the command 'psconfig'
 
-# list the current settings 
-if ($#argv == 0) then
-  if (! $?PSCONFDIR) echo "PSCONFDIR is not set : run psconfig with an argument to setup"
-  if (! $?PSVERSION) echo "PSVERSION is not set : run psconfig with an argument to setup"
-  if (! $?ARCH)      echo "ARCH is not set : run psconfig with an argument to setup"
-  echo $PSCONFDIR : $PSVERSION : $ARCH 
-  echo "psconfig --help for additional info"
-  exit 2
-endif
-
-# show usage information
-if ("$argv[1]" == "--help") then
-  echo "psconfig: set or show the current pslib configuration information"
-  echo "USAGE: psconfig (version) : set configuration to specified version"
-  echo "       psconfig --bin     : return the current path"
-  echo "       psconfig --libs    : return the current library path"
-  echo "       psconfig --list    : list currently availabe configuration versions"
-  echo "       psconfig --help    : this listing"
-  echo " use ~/.psconfigrc to set PSCONFDIR as desired"
-  exit 0
-endif
-
-# list the defined psconfig versions
-if ("$argv[1]" == "--list") then
-  /bin/ls $PSCONFDIR | grep -v "\<man\>" | grep -v "\<share\>" | awk -v dir=$PSCONFDIR -F. '{printf "%s : %-10s : %s\n", dir, $1, $2}'
-  exit 0
-endif
-
-# list the defined psconfig versions
-if ("$argv[1]" == "--prefix") then
-  echo $PSCONFDIR/$PSVERSION.$ARCH
-  exit 0
-endif
-
-# list the defined psconfig versions
-if ("$argv[1]" == "--libs") then
-  echo $PSCONFDIR/$PSVERSION.$ARCH/lib
-  exit 0
-endif
-
-# list the defined psconfig versions
-if ("$argv[1]" == "--bin") then
-  echo $PSCONFDIR/$PSVERSION.$ARCH/bin
-  exit 0
-endif
-
 # list the defined psconfig versions
 set show_configure = 0
-if ("$argv[1]" == "--psconfigure") then
-  set show_configure = 1
-  shift
-endif
-
-# list the defined psconfig versions
 set show_autogen = 0
-if ("$argv[1]" == "--psautogen") then
-  set show_autogen = 1
-  shift
-endif
-
-# list the defined psconfig versions
-set show_psperlbuild = 0
-if ("$argv[1]" == "--psperlbuild") then
-  set show_psperlbuild = 1
-  shift
-endif
+set show_perlbuild = 0
+set args = ""
+while ($#argv) 
+  switch ($argv[1])
+    case --help:
+      goto help;
+
+    case --list:
+      /bin/ls $PSCONFDIR | grep -v "\<man\>" | grep -v "\<share\>" | awk -v dir=$PSCONFDIR -F. '{printf "%s : %-10s : %s\n", dir, $1, $2}'
+      exit 0
+      breaksw
+
+    case --prefix:
+      echo $PSCONFDIR/$PSVERSION.$ARCH
+      exit 0
+      breaksw
+
+    case --libs:
+      echo $PSCONFDIR/$PSVERSION.$ARCH/lib
+      exit 0
+      breaksw
+
+    case --bin
+      echo $PSCONFDIR/$PSVERSION.$ARCH/bin
+      exit 0
+      breaksw
+
+    case --psconfigure:
+      set show_configure = 1
+      shift
+      breaksw;   
+    case --psautogen:
+      set show_autogen = 1
+      shift
+      breaksw;
+    case --psperlbuild:
+      set show_perlbuild = 1
+      shift
+      breaksw;
+    case -*:
+      echo "unknown option $1"
+      goto help;
+    default:
+      set args=($args $1);
+      shift
+      breaksw;
+  endsw
+end
+if ($#args != 1) goto usage
+if ("$args" == "") goto usage
 
 # make this configurable by the user
@@ -77,5 +64,5 @@
 endif
 
-setenv PSVERSION $argv[1]
+setenv PSVERSION $args[1]
 
 if ($?LD_LIBRARY_PATH == 0) setenv LD_LIBRARY_PATH
@@ -290,2 +277,22 @@
   exit 0
 endif
+
+exit 0
+
+usage:
+  if (! $?PSCONFDIR) echo "PSCONFDIR is not set : run psconfig with an argument to setup"
+  if (! $?PSVERSION) echo "PSVERSION is not set : run psconfig with an argument to setup"
+  if (! $?ARCH)      echo "ARCH is not set : run psconfig with an argument to setup"
+  echo $PSCONFDIR : $PSVERSION : $ARCH 
+  echo "psconfig --help for additional info"
+  exit 2
+
+help:
+  echo "psconfig: set or show the current pslib configuration information"
+  echo "USAGE: psconfig (version) : set configuration to specified version"
+  echo "       psconfig --bin     : return the current path"
+  echo "       psconfig --libs    : return the current library path"
+  echo "       psconfig --list    : list currently availabe configuration versions"
+  echo "       psconfig --help    : this listing"
+  echo " use ~/.psconfigrc to set PSCONFDIR as desired"
+  exit 1
