Index: trunk/psconfig/psbuild
===================================================================
--- trunk/psconfig/psbuild	(revision 18263)
+++ trunk/psconfig/psbuild	(revision 18315)
@@ -19,66 +19,66 @@
 for (; @ARGV > 0; ) {
     if ($ARGV[0] eq "-version") {
-	$version = $ARGV[1];
+        $version = $ARGV[1];
         shift; shift; next;
     }
     if ($ARGV[0] eq "-verbose") {
-	$verbose = 1;
+        $verbose = 1;
         shift; next;
     }
     if ($ARGV[0] eq "-extlibs") {
-	$extlibs = $ARGV[1];
+        $extlibs = $ARGV[1];
         shift; shift; next;
     }
     if ($ARGV[0] eq "-extperl") {
-	$extperl = $ARGV[1];
+        $extperl = $ARGV[1];
         shift; shift; next;
     }
     if ($ARGV[0] eq "-clean") {
-	$clean = 1;
+        $clean = 1;
         shift; next;
     }
     if ($ARGV[0] eq "-extcheck") {
-	$extlibs = "check";
-	$extperl = "check";
+        $extlibs = "check";
+        $extperl = "check";
         shift; next;
     }
     if ($ARGV[0] eq "-extbuild") {
-	$extlibs = "build";
-	$extperl = "build";
+        $extlibs = "build";
+        $extperl = "build";
         shift; next;
     }
     if ($ARGV[0] eq "-rebuild") {
-	$rebuild = 1;
+        $rebuild = 1;
         shift; next;
     }
     if ($ARGV[0] eq "-optimize") {
-	$optimize = 1;
+        $optimize = 1;
         shift; next;
     }
     if ($ARGV[0] eq "-dev") {
-	$developer = 1;
+        $developer = 1;
         shift; next;
     }
     if ($ARGV[0] eq "-only") {
-	$start = $ARGV[1];
-	$stop = $ARGV[1];
+        $start = $ARGV[1];
+        $stop = $ARGV[1];
         shift; shift; next;
     }
     if ($ARGV[0] eq "-start") {
-	$start = $ARGV[1];
+        $start = $ARGV[1];
         shift; shift; next;
     }
     if ($ARGV[0] eq "-stop") {
-	$stop = $ARGV[1];
+        $stop = $ARGV[1];
         shift; shift; next;
     }
     if ($ARGV[0] eq "-list") {
-	&list_distributions ();
+        &list_distributions ();
     }
     if ($ARGV[0] eq "-bootstrap") {
-	&bootstrap ();
+        &bootstrap ();
     }
     if ($ARGV[0] eq "-env") {
-	&show_environment ();
+        &show_environment ();
     }
     if ($ARGV[0] eq "-h")     { &usage (); }
@@ -90,5 +90,5 @@
 @ARGV = @tARGV;
 
-if ( @ARGV == 0) { 
+if ( @ARGV == 0) {
     @list = <$tagsets/*.dist>;
     $distribution = $list[-1];
@@ -111,20 +111,20 @@
 
 sub show_environment {
-    
+
     # use psconfig.csh to set needed build aliases
 
     # set the psconfig version:
     if ("$version" eq "") {
-	$version = $ENV{'PSVERSION'};
+        $version = $ENV{'PSVERSION'};
     }
     if ("$version" eq "") {
-	$version = "default";
+        $version = "default";
     }
 
     if (! -e psconfig.csh) {
-	$psconfdir = $ENV{'PSCONFDIR'};
-	if ($psconfdir eq "") { die "PSCONFDIR not found, run psbuild -bootstrap and follow instructions\n"; }
-	vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh");
-	vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash");
+        $psconfdir = $ENV{'PSCONFDIR'};
+        if ($psconfdir eq "") { die "PSCONFDIR not found, run psbuild -bootstrap and follow instructions\n"; }
+        vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh");
+        vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash");
     }
 
@@ -138,7 +138,7 @@
 
     # set build environment variables
-    ps_setenv (1, "PATH", 		  "--path");
-    ps_setenv (1, "CPATH",		  "--cpath");
-    ps_setenv (1, "ARCH", 		  "--arch");
+    ps_setenv (1, "PATH",                 "--path");
+    ps_setenv (1, "CPATH",                "--cpath");
+    ps_setenv (1, "ARCH",                 "--arch");
     ps_setenv (1, "LIBRARY_PATH",    "--library_path");
     ps_setenv (1, "LD_LIBRARY_PATH", "--ld_library_path");
@@ -151,31 +151,31 @@
 
 sub build_distribution {
-    
+
     # use psconfig.csh to set needed build aliases
 
-    if ($extlibs eq "check") { 
-	$status = vsystem ("pschecklibs");
-	if ($status) { die "failed to find external libraries\n"; }
-    }
-    if ($extlibs eq "build") { 
-	$status = vsystem ("pschecklibs -build");
-	if ($status) { die "failed to build external libraries\n"; }
-    }
-
-    if ($extperl eq "check") { 
-	$status = vsystem ("pschecklperl");
-	if ($status) { die "failed to find external perl modules\n"; }
-    }
-    if ($extperl eq "build") { 
-	$status = vsystem ("pscheckperl -build");
-	if ($status) { die "failed to build external perl modules\n"; }
+    if ($extlibs eq "check") {
+        $status = vsystem ("pschecklibs");
+        if ($status) { die "failed to find external libraries\n"; }
+    }
+    if ($extlibs eq "build") {
+        $status = vsystem ("pschecklibs -build");
+        if ($status) { die "failed to build external libraries\n"; }
+    }
+
+    if ($extperl eq "check") {
+        $status = vsystem ("pschecklperl");
+        if ($status) { die "failed to find external perl modules\n"; }
+    }
+    if ($extperl eq "build") {
+        $status = vsystem ("pscheckperl -build");
+        if ($status) { die "failed to build external perl modules\n"; }
     }
 
     # set the psconfig version:
     if ("$version" eq "") {
-	$version = $ENV{'PSVERSION'};
+        $version = $ENV{'PSVERSION'};
     }
     if ("$version" eq "") {
-	$version = "default";
+        $version = "default";
     }
 
@@ -189,7 +189,7 @@
 
     # set build environment variables
-    ps_setenv (0, "PATH", 		  "--path");
-    ps_setenv (0, "CPATH",		  "--cpath");
-    ps_setenv (0, "ARCH", 		  "--arch");
+    ps_setenv (0, "PATH",                 "--path");
+    ps_setenv (0, "CPATH",                "--cpath");
+    ps_setenv (0, "ARCH",                 "--arch");
     ps_setenv (0, "LIBRARY_PATH",    "--library_path");
     ps_setenv (0, "LD_LIBRARY_PATH", "--ld_library_path");
@@ -213,83 +213,83 @@
     $stop_now = 0;
     for ($i = 0; !$stop_now && ($i < @cvsname); $i++) {
-	if (($stop ne "") && ($stop eq $cvsname[$i])) { $stop_now = 1; }
-	if (($start ne "") && ($start ne $cvsname[$i])) { next; }
-	$start = "";
-
-	($do_tag, $do_build, $do_package, $do_update, $dev_build) = $mode[$i] =~ m|(\S)(\S)(\S)(\S)(\S)|;
-	if ($developer) { $do_build = $dev_build; }
-	if ($do_build eq "N") { next; }
-
-	$workdir = "../$cvsname[$i]";
-
-	# XXX need to grab current value for cleanup
-	print "\n ** psbuild: $cvsname[$i] ** \n";
-	print "\033]0; ** psbuild: $cvsname[$i] ** \007";
-
-	if (!-d $workdir || !-r $workdir || !-x $workdir) { 
-	    print STDERR "WARNING: no directory for component $cvsname[$i], skipping\n"; 
-	    next;
-	}
-	
-	chdir $workdir;
-
-	# how do we build this component?
-	# - autogen.sh : configure : make : make install
-	# - configure : make : make install
-	# - make : make install
-	# - perl Build.PL : ./Build : ./Build install
- 
-	if (-e "Build.PL") {
-	    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;
-	}
-
-	if ($rebuild && $clean) {
-	    if (-e "configure") { unlink "Makefile"; }
-	    if ($developer && -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; }
-
-	#  run autogen
-	$skip_configure = 0;
-	if ($developer && $rebuild_this && ! -e "configure" && -e "autogen.sh") {
-	    $skip_configure = 1;
-	    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: do you need to run the -dev developer build?"); }
-
-	if ($clean) { 
-	    vsystem ("make clean");
-	    if ($?) { &failure($cvsname[$i], "failure in make clean"); }
-	}
-
-	vsystem ("make");
-	if ($?) { &failure($cvsname[$i], "failure in make"); }
-
-	vsystem ("make install");
-	if ($?) { &failure($cvsname[$i], "failure in make install"); }
-
-	print "*** done with $cvsname[$i] ***\n";
+        if (($stop ne "") && ($stop eq $cvsname[$i])) { $stop_now = 1; }
+        if (($start ne "") && ($start ne $cvsname[$i])) { next; }
+        $start = "";
+
+        ($do_tag, $do_build, $do_package, $do_update, $dev_build) = $mode[$i] =~ m|(\S)(\S)(\S)(\S)(\S)|;
+        if ($developer) { $do_build = $dev_build; }
+        if ($do_build eq "N") { next; }
+
+        $workdir = "../$cvsname[$i]";
+
+        # XXX need to grab current value for cleanup
+        print "\n ** psbuild: $cvsname[$i] ** \n";
+        print "\033]0; ** psbuild: $cvsname[$i] ** \007";
+
+        if (!-d $workdir || !-r $workdir || !-x $workdir) {
+            print STDERR "WARNING: no directory for component $cvsname[$i], skipping\n";
+            next;
+        }
+
+        chdir $workdir;
+
+        # how do we build this component?
+        # - autogen.sh : configure : make : make install
+        # - configure : make : make install
+        # - make : make install
+        # - perl Build.PL : ./Build : ./Build install
+
+        if (-e "Build.PL") {
+            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;
+        }
+
+        if ($rebuild && $clean) {
+            if (-e "configure") { unlink "Makefile"; }
+            if ($developer && -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; }
+
+        #  run autogen
+        $skip_configure = 0;
+        if ($developer && $rebuild_this && ! -e "configure" && -e "autogen.sh") {
+            $skip_configure = 1;
+            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: do you need to run the -dev developer build?"); }
+
+        if ($clean) {
+            vsystem ("make clean");
+            if ($?) { &failure($cvsname[$i], "failure in make clean"); }
+        }
+
+        vsystem ("make");
+        if ($?) { &failure($cvsname[$i], "failure in make"); }
+
+        vsystem ("make install");
+        if ($?) { &failure($cvsname[$i], "failure in make install"); }
+
+        print "*** done with $cvsname[$i] ***\n";
 
       success:
-	chdir $homedir;
+        chdir $homedir;
     }
     print "\033]0; ** psbuild: finished ** \007";
@@ -306,7 +306,7 @@
     @list = <$tagsets/*.dist>;
     foreach $line (@list) {
-	chomp $line;
-	($dist) = $line =~ m|$tagsets/(\S*).dist|;
-	print STDERR "$dist\n";
+        chomp $line;
+        ($dist) = $line =~ m|$tagsets/(\S*).dist|;
+        print STDERR "$dist\n";
     }
     exit 2;
@@ -326,7 +326,8 @@
     vsystem ("cp psconfig.csh $psconfdir/psconfig.csh");
     vsystem ("cp psconfig.bash $psconfdir/psconfig.bash");
+    vsystem ("chmod u+x $psconfdir/psconfig.bash");
 
     print STDOUT "\n";
-    
+
     print STDOUT "** if you use csh, tcsh or equivalent as your shell, add the following to your .cshrc\n";
     print STDOUT "    if (-e $psconfdir/psconfig.csh) then\n";
@@ -363,25 +364,25 @@
 
     foreach $line (@list) {
-	chop $line;
-	if ($line =~ m|^\s*$|) { next; }
-	if ($line =~ m|^\s*\#|) { next; }
-
-	($mode, $cvsname, $branchtag, $branchver) = split (" ", $line);
-	
-	if ($cvsname eq "") { die "missing module name\n"; }
-
-	($do_tag, $do_build, $do_package, $do_update) = $mode =~ m|(\S)(\S)(\S)(\S)|;
-	if (($do_tag ne "Y") && ($do_tag ne "N")) { die "invalid tag option $do_tag\n"; }
-	if (($do_build ne "Y") && ($do_build ne "N")) { die "invalid tag option $do_build\n"; }
-	if (($do_package ne "Y") && ($do_package ne "N")) { die "invalid tag option $do_package\n"; }
-	if (($do_update ne "Y") && ($do_update ne "N")) { die "invalid tag option $do_update\n"; }
-	
-	if ($verbose) { print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update "; }
-	if ($verbose) { print "module: $cvsname, branchtag: $branchtag, branchver: $branchver \n"; }
-
-	push @mode, $mode;
-	push @cvsname, $cvsname;
-	push @branchtag, $branchtag;
-	push @branchver, $branchver;
+        chop $line;
+        if ($line =~ m|^\s*$|) { next; }
+        if ($line =~ m|^\s*\#|) { next; }
+
+        ($mode, $cvsname, $branchtag, $branchver) = split (" ", $line);
+
+        if ($cvsname eq "") { die "missing module name\n"; }
+
+        ($do_tag, $do_build, $do_package, $do_update) = $mode =~ m|(\S)(\S)(\S)(\S)|;
+        if (($do_tag ne "Y") && ($do_tag ne "N")) { die "invalid tag option $do_tag\n"; }
+        if (($do_build ne "Y") && ($do_build ne "N")) { die "invalid tag option $do_build\n"; }
+        if (($do_package ne "Y") && ($do_package ne "N")) { die "invalid tag option $do_package\n"; }
+        if (($do_update ne "Y") && ($do_update ne "N")) { die "invalid tag option $do_update\n"; }
+
+        if ($verbose) { print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update "; }
+        if ($verbose) { print "module: $cvsname, branchtag: $branchtag, branchver: $branchver \n"; }
+
+        push @mode, $mode;
+        push @cvsname, $cvsname;
+        push @branchtag, $branchtag;
+        push @branchver, $branchver;
     }
 }
@@ -426,6 +427,6 @@
     $ENV{$var} = $answer;
     if ($verbose) {
-	print STDERR "$var = $answer\n";
-    }
-}
-
+        print STDERR "$var = $answer\n";
+    }
+}
+
