Changeset 27840 for branches/simtest_nebulous_branches/psconfig/pscheckperl
- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/psconfig
- Property svn:ignore
-
old new 2 2 psconfig.csh 3 3 psconfig.bash 4 build.log
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/psconfig/pscheckperl
r24670 r27840 9 9 for (; @ARGV > 0; ) { 10 10 if ($ARGV[0] eq "-version") { 11 $version = $ARGV[1];11 $version = $ARGV[1]; 12 12 shift; shift; next; 13 13 } 14 14 if ($ARGV[0] eq "-build") { 15 $build = 1;15 $build = 1; 16 16 shift; next; 17 17 } 18 18 if ($ARGV[0] eq "-force") { 19 $force{$ARGV[1]} = 1;20 shift; shift; next;19 $force{$ARGV[1]} = 1; 20 shift; shift; next; 21 21 } 22 if ($ARGV[0] eq "-path") { &list_include_path (); } 22 23 if ($ARGV[0] eq "-h") { &usage (); } 23 24 if ($ARGV[0] eq "help") { &usage (); } … … 31 32 if ( @ARGV > 1) { &usage(); } 32 33 33 if ( @ARGV == 0) { 34 if ( @ARGV == 0) { 34 35 @list = <$tagsets/*.perl>; 35 36 $file = $list[-1]; … … 52 53 } 53 54 55 # generate new psconfig.csh if needed 56 if (! -e "psconfig.csh" || ! -e "psconfig.bash") { 57 $psconfdir = $ENV{'PSCONFDIR'}; 58 if ($psconfdir eq "") { die "PSCONFDIR not found, run psbuild -bootstrap and follow instructions\n"; } 59 vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh"); 60 vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash"); 61 } 54 62 55 63 $prefix = `csh -f psconfig.csh --prefix $version`; chomp $prefix; … … 77 85 if ($line =~ m|^\s*\#|) { next; } 78 86 79 ($N, $module, $tarball, $modver, $prompts) = split (" ", $line); 87 $Nvalue = ($N, $module, $tarball, $modver, $buildopts, $prompts) = split (" ", $line); 88 if ($Nvalue < 6) { 89 print "Error in perl module config line $line\n"; 90 exit 1; 91 } 92 # print "N: $N, module: $module, tarball: $tarball, modver: $modver, buildopts: $buildopts, prompts: $prompts\n"; 80 93 81 if ($modver eq "") { $modver = 0; } 94 # we require the number of fields to be fixed, so this test is now invalid: 95 # if ($modver eq "") { $modver = 0; } 96 82 97 system ("pscheckmods $module $modver"); 83 if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) { 84 # print "$module: found\n";85 next; 98 if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) { 99 # print "$module: found\n"; 100 next; 86 101 } 87 102 88 103 if (defined $force{$module}) { 89 print "$module: force\n";104 print "$module: force\n"; 90 105 } else { 91 print "$module: missing\n";106 print "$module: missing\n"; 92 107 } 93 unless ($build or defined $force{$module} or defined $force{'all'}) { 94 $Nmissing ++;95 push @missing, $module;96 next; 108 unless ($build or defined $force{$module} or defined $force{'all'}) { 109 $Nmissing ++; 110 push @missing, $module; 111 next; 97 112 } 98 113 … … 102 117 print "extract $module from $tarball\n"; 103 118 vsystem ("tar xvzf $tarball"); 104 119 105 120 ($tardir) = $tarball =~ m|(\S*).tar.gz|; 106 121 print "tardir: $tardir\n"; … … 108 123 chdir $tardir; 109 124 110 # build the MakeMaker makefile, setting the output directories 111 if ($prompts) { 112 @answers = split (",", $prompts); 113 open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perldir"); 114 foreach $answer (@answers) { 115 print PIPE "$answer\n"; 116 } 117 close (PIPE); 125 # we use NONE as the empty word 126 if ($buildopts eq "NONE") { $buildopts = ""; } 127 if ($prompts eq "NONE") { $prompts = ""; } 128 129 if (-e "Build.PL" and $module ne "Params::Validate" and $module ne "DateTime::TimeZone") { 130 # vsystem("perl Build.PL --install_path lib=$perldir "); 131 vsystem("perl Build.PL --install_base $prefix $buildopts"); 132 vsystem("Build"); 133 vsystem("Build install"); 118 134 } else { 119 vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perldir"); 135 # build the MakeMaker makefile, setting the output directories 136 if ($prompts) { 137 @answers = split (",", $prompts); 138 open (PIPE, "|perl Makefile.PL PREFIX=$prefix LIB=$perldir $buildopts"); 139 foreach $answer (@answers) { 140 print PIPE "$answer\n"; 141 } 142 close (PIPE); 143 } else { 144 vsystem ("perl Makefile.PL PREFIX=$prefix LIB=$perldir $buildopts"); 145 } 146 vsystem ("make < /dev/null"); 147 vsystem ("make install"); 120 148 } 121 122 vsystem ("make < /dev/null");123 vsystem ("make install");124 149 125 150 chdir $homedir; … … 127 152 if (!$build) { 128 153 if ($Nmissing > 0) { 129 print "The following $Nmissing perl modules are missing from your system\n";130 foreach $name (@missing) {131 print " $name\n";132 }133 print "you may install them in your local path by re-running pscheckperl with -build\n";154 print "The following $Nmissing perl modules are missing from your system\n"; 155 foreach $name (@missing) { 156 print " $name\n"; 157 } 158 print "you may install them in your local path by re-running pscheckperl with -build\n"; 134 159 } else { 135 print "no perl modules are missing from your system\n";160 print "no perl modules are missing from your system\n"; 136 161 } 137 162 } … … 139 164 140 165 sub usage { 141 print STDERR "USAGE: pscheckperl [-version] [-build] \n";166 print STDERR "USAGE: pscheckperl [-version] [-build] [-path]\n"; 142 167 exit 2; 143 168 } … … 152 177 @list = <$tagsets/*.perl>; 153 178 foreach $line (@list) { 154 chomp $line;155 ($dist) = $line =~ m|$tagsets/(\S*).perl|;156 print STDERR "$dist\n";179 chomp $line; 180 ($dist) = $line =~ m|$tagsets/(\S*).perl|; 181 print STDERR "$dist\n"; 157 182 } 158 183 exit 2; 159 184 } 185 186 sub list_include_path { 187 foreach $path (@INC) { 188 print STDERR "$path\n"; 189 } 190 exit 2; 191 }
Note:
See TracChangeset
for help on using the changeset viewer.
