Changeset 1678 for trunk/gsdl
- Timestamp:
- 2000-11-20T14:00:34+13:00 (24 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/build
r1507 r1678 24 24 use util; 25 25 use cfgread; 26 27 # set up path - this allows for paths not to be supplied to system calls 28 # and overcomes problems when GSDLHOME contains spaces (double quoting 29 # the call doesn't work on win2k and probably other variants of winnt) 30 my $path_separator = ":"; 31 $path_separator = ";" if $ENV{'GSDLOS'} =~ /^windows$/; 32 $ENV{'PATH'} = &util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}) . 33 $path_separator . &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script") . 34 $path_separator . $ENV{'PATH'}; 26 35 27 36 &parse_args (\@ARGV); … … 149 158 if (-e $download_dir) { 150 159 # copy download_dir and all it contains to the import directory 151 my $download_cmd = "perl " . &util::filename_cat ($bindir, "script", "filecopy.pl");160 my $download_cmd = "perl -S filecopy.pl"; 152 161 $download_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; 153 162 $download_cmd .= " -out \"$outfile.download\"" if $use_out; … … 226 235 print $out "importing the $collection collection\n\n"; 227 236 228 my $import_cmd = "perl " . &util::filename_cat ($bindir, "script", "import.pl");237 my $import_cmd = "perl -S import.pl"; 229 238 $import_cmd .= " -out \"$outfile.import\"" if $use_out; 230 239 $import_cmd .= " -removeold" unless $append; … … 252 261 print $out "building the $collection collection\n\n"; 253 262 254 my $build_cmd = "perl " . &util::filename_cat ($bindir, "script", "buildcol.pl");263 my $build_cmd = "perl -S buildcol.pl"; 255 264 $build_cmd .= " -out \"$outfile.build\"" if $use_out; 256 265 $build_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; -
trunk/gsdl/lib/gsdltools.cpp
r1456 r1678 26 26 #include "gsdltools.h" 27 27 28 #if defined(__WIN32__) 29 #include <windows.h> 30 #include <process.h> 31 #endif 32 28 33 bool littleEndian() { 29 34 char s[2] = {'\xFE', '\xEF'}; … … 52 57 // characters (e.g. '&') should be quoted with "" 53 58 54 // on unix systems youcan get the same effext as this function by doing a55 // system call and putting the spawned process in the background56 // (e.g. system (funcname options &);57 58 59 #if defined (__WIN32__) 59 #include <windows.h>60 60 void gsdl_system (char *cmd, ostream &logout) { 61 61 … … 101 101 } 102 102 } 103 #endif 103 104 105 106 // gsdl_call_perl executes the perl script perl_cmd, passing it all the 107 // arguments provided. 108 109 // Arguments should be char*'s, the last argument should be NULL 110 111 // perl_cmd shouldn't contain the path to the script as we use "perl -S" 112 // to find it. This means that the PATH environment variable of the calling 113 // process should contain the directory where the perl_cmd script lives. 114 115 // Uses a standard system() call on unix and a synchronous _spawn() on windows. 116 // We use the _spawn() because windows 9* doesn't seem to pass the 117 // environment of the calling process to the new process when using 118 // system (which we need to do). 119 120 // all arguments will be quoted with double quotes [""] so they should be unquoted 121 // when passed in. 122 123 // returns the exit status of the called process (-1 if system() or _spawn() failed) 124 125 int gsdl_call_perl (char *perl_cmd, ...) { 126 127 va_list argn; 128 char *thisarg = perl_cmd; 129 130 #if defined(__WIN32__) && !defined (__GNUC__) 131 int i = 2; 132 #define GSDL_MAX_ARGS 20 133 char *args[GSDL_MAX_ARGS]; 134 args[0] = "perl"; 135 args[1] = "-S"; 136 #else 137 text_t cmd = "perl -S"; 104 138 #endif 139 140 // get arguments 141 va_start(argn, perl_cmd); 142 while(thisarg != NULL) { 143 #if defined(__WIN32__) && !defined (__GNUC__) 144 if (i >= GSDL_MAX_ARGS) break; 145 text_t tmp = thisarg; 146 tmp = "\"" + tmp + "\""; 147 args[i] = tmp.getcstr(); 148 i++; 149 #else 150 cmd += " \""; 151 cmd += thisarg; 152 cmd.push_back ('"'); 153 #endif 154 thisarg = va_arg(argn, char *); 155 } 156 va_end(argn); 157 158 #if defined(__WIN32__) && !defined (__GNUC__) 159 args[i] = NULL; 160 int rv = _spawnvp (_P_WAIT, "perl", args); 161 while (--i > 2) delete (args[i]); 162 #else 163 char *cmdc = cmd.getcstr(); 164 int rv = system (cmdc); 165 delete (cmdc); 166 #endif 167 return rv; 168 } -
trunk/gsdl/lib/gsdltools.h
r1456 r1678 36 36 bool littleEndian(); 37 37 38 38 39 // escapes '\' and '_' characters with '\' 39 40 // note that single '\' characters occurring … … 46 47 // program continues and terminates normally). Arguments containing special 47 48 // characters (e.g. '&') should be quoted with "" 49 void gsdl_system (char *cmd, ostream &logout); 48 50 49 // on unix systems youcan get the same effext as this function by doing a 50 // system call and putting the spawned process in the background 51 // (e.g. system (funcname options &); 52 //#if defined (__WIN32__) 53 void gsdl_system (char *cmd, ostream &logout); 54 //#endif 51 52 // gsdl_call_perl executes the perl script perl_cmd, passing it all the 53 // arguments provided. 54 55 // Arguments should be text_t's, the last argument should be an empty text_t. 56 57 // perl_cmd shouldn't contain the path to the script as we use "perl -S" 58 // to find it. This means that the PATH environment variable of the calling 59 // process should contain the directory where the perl_cmd script lives. 60 61 // Uses a standard system() call on unix and a synchronous _spawn() on windows. 62 // We use the _spawn() because windows 9* doesn't seem to pass the 63 // environment of the calling process to the new process when using 64 // system (which we need to do). 65 66 // all arguments will be quoted with double quotes [""] so they should be unquoted 67 // when passed in. 68 69 // returns the exit status of the called process (-1 if system() or _spawn() failed) 70 int gsdl_call_perl (char *perl_cmd, ...); 71 55 72 56 73 #endif -
trunk/gsdl/macros/collect.dm
r1655 r1678 982 982 deleted. Possible causes are: 983 983 <ul> 984 <li> Greenstone does not have permission to delete the gsdl/collect/_cgibc1dirname_984 <li> Greenstone does not have permission to delete the _gsdlhome_/collect/_cgiargbc1dirname_ 985 985 directory. 986 986 </ul> … … 1027 1027 directory. Possible causes are: 1028 1028 <ul> 1029 <li> Greenstone does not have read/write access to the gsdl/tmp1029 <li> Greenstone does not have read/write access to the _gsdlhome_/tmp 1030 1030 directory. 1031 1031 </ul> … … 1040 1040 collection (mkcol.pl failed). Possible causes are: 1041 1041 <ul> 1042 <li> Greenstone does not have permission to write to the gsdl/tmp1042 <li> Greenstone does not have permission to write to the _gsdlhome_/tmp 1043 1043 directory. 1044 1044 <li> mkcol.pl perl script errors. … … 1077 1077 Possible causes are: 1078 1078 <ul> 1079 <li> Greenstone does not have permission to write to the gsdl/collect1079 <li> Greenstone does not have permission to write to the _gsdlhome_/collect 1080 1080 directory. 1081 <li> A _cgiarg sbc1dirname_ collection already exists in the gsdl/collect1081 <li> A _cgiargbc1dirname_ collection already exists in the _gsdlhome_/collect 1082 1082 directory. 1083 1083 </ul>
Note:
See TracChangeset
for help on using the changeset viewer.