Changeset 2359
- Timestamp:
- 2001-05-04T11:15:58+12:00 (23 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/build
r1970 r2359 135 135 136 136 sub print_usage { 137 print STD ERR"\n";138 print STD ERR"build: Builds a Greenstone collection (i.e. runs import.pl and buildcol.pl\n";139 print STD ERR" then copies the resulting indexes to the correct place).\n\n";140 print STD ERR" usage: $0 [options] collection-name\n\n";141 print STD ERR" options:\n";142 print STD ERR" -optionfile file Get options from file, useful on systems where\n";143 print STD ERR" long command lines may cause problems\n";144 print STD ERR" -append Add new files to existing collection\n";145 print STD ERR" -remove_archives Remove archives directory after successfully\n";146 print STD ERR" building the collection.\n";147 print STD ERR" -remove_import Remove import directory after successfully\n";148 print STD ERR" importing the collection.\n";149 print STD ERR" -buildtype build|import If 'build' attempt to build directly\n";150 print STD ERR" from archives directory (bypassing import\n";151 print STD ERR" stage). Defaults to 'import'\n";152 print STD ERR" -maxdocs number Maximum number of documents to build\n";153 print STD ERR" -download directory Directory (or file) to get import documents from.\n";154 print STD ERR" There may be multiple download directories and they\n";155 print STD ERR" may be of type http://, ftp://, or file://\n";156 print STD ERR" Note that any existing import directory will be\n";157 print STD ERR" deleted to make way for the downloaded data if\n";158 print STD ERR" a -download option is supplied\n";159 print STD ERR" -collectdir directory Collection directory (defaults to " .137 print STDOUT "\n"; 138 print STDOUT "build: Builds a Greenstone collection (i.e. runs import.pl and buildcol.pl\n"; 139 print STDOUT " then copies the resulting indexes to the correct place).\n\n"; 140 print STDOUT " usage: $0 [options] collection-name\n\n"; 141 print STDOUT " options:\n"; 142 print STDOUT " -optionfile file Get options from file, useful on systems where\n"; 143 print STDOUT " long command lines may cause problems\n"; 144 print STDOUT " -append Add new files to existing collection\n"; 145 print STDOUT " -remove_archives Remove archives directory after successfully\n"; 146 print STDOUT " building the collection.\n"; 147 print STDOUT " -remove_import Remove import directory after successfully\n"; 148 print STDOUT " importing the collection.\n"; 149 print STDOUT " -buildtype build|import If 'build' attempt to build directly\n"; 150 print STDOUT " from archives directory (bypassing import\n"; 151 print STDOUT " stage). Defaults to 'import'\n"; 152 print STDOUT " -maxdocs number Maximum number of documents to build\n"; 153 print STDOUT " -download directory Directory (or file) to get import documents from.\n"; 154 print STDOUT " There may be multiple download directories and they\n"; 155 print STDOUT " may be of type http://, ftp://, or file://\n"; 156 print STDOUT " Note that any existing import directory will be\n"; 157 print STDOUT " deleted to make way for the downloaded data if\n"; 158 print STDOUT " a -download option is supplied\n"; 159 print STDOUT " -collectdir directory Collection directory (defaults to " . 160 160 &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n"; 161 print STDERR " -dontinstall Only applicable if -collectdir is set to something\n"; 162 print STDERR " other than the default. -dontinstall will suppress the\n"; 163 print STDERR " default behaviour which is to install the collection to\n"; 164 print STDERR " the gsdl/collect directory once it has been built.\n"; 165 print STDERR " -save_archives Create a copy of the existing archives directory called\n"; 166 print STDERR " archives.org\n"; 167 print STDERR " -out Filename or handle to print output status to.\n"; 168 print STDERR " The default is STDERR\n"; 169 print STDERR " -log_events Log important events (collection built successfully etc.)\n"; 170 print STDERR " to event_log_file\n"; 171 print STDERR " -event_log_file file File to append important events to (defaults to\n"; 172 print STDERR " " . &util::filename_cat ($ENV{'GSDLHOME'}, "etc", "events.txt") . "\n"; 173 print STDERR " -email_events addr Comma separated list of email addresses to mail details\n"; 174 print STDERR " of important collection building events\n"; 175 print STDERR " -mail_server server The outgoing (SMTP) mail server to be used by email_events.\n"; 176 print STDERR " email_events will be disabled if mail_server isn't set\n"; 177 print STDERR " -event_header file File containing a header to go on any event messages. If not\n"; 178 print STDERR " specified build will create a generic header\n\n"; 161 print STDOUT " -dontinstall Only applicable if -collectdir is set to something\n"; 162 print STDOUT " other than the default. -dontinstall will suppress\n"; 163 print STDOUT " the default behaviour which is to install the\n"; 164 print STDOUT " collection to the gsdl/collect directory once it has\n"; 165 print STDOUT " been built.\n"; 166 print STDOUT " -save_archives Create a copy of the existing archives directory\n"; 167 print STDOUT " called archives.org\n"; 168 print STDOUT " -out Filename or handle to print output status to.\n"; 169 print STDOUT " The default is STDERR\n"; 170 print STDOUT " -log_events Log important events (collection built successfully\n"; 171 print STDOUT " etc.) to event_log_file\n"; 172 print STDOUT " -event_log_file file File to append important events to (defaults to\n"; 173 print STDOUT " " . &util::filename_cat ($ENV{'GSDLHOME'}, "etc", "events.txt") . "\n"; 174 print STDOUT " -email_events addr Comma separated list of email addresses to mail\n"; 175 print STDOUT " details of important collection building events\n"; 176 print STDOUT " -mail_server server The outgoing (SMTP) mail server to be used by\n"; 177 print STDOUT " email_events. email_events will be disabled if\n"; 178 print STDOUT " mail_server isn't set\n"; 179 print STDOUT " -event_header file File containing a header to go on any event\n"; 180 print STDOUT " messages. If not specified build will create a\n"; 181 print STDOUT " generic header\n\n"; 182 print STDOUT " [Type \"perl -S buildcol.pl | more\" if this help text scrolled off your screen]"; 183 print STDOUT "\n" unless $ENV{'GSDLOS'} =~ /^windows$/i; 179 184 } 180 185 -
trunk/gsdl/bin/script/buildcol.pl
r2355 r2359 44 44 45 45 sub print_usage { 46 print STD ERR"\n";47 print STD ERR"buildcol.pl: Builds the indexes of a Greenstone collection.\n\n";48 print STD ERR" usage: $0 [options] collection-name\n\n";49 print STD ERR" options:\n";50 print STD ERR" -verbosity number 0=none, 3=lots\n";51 print STD ERR" -archivedir directory Where the archives live\n";52 print STD ERR" -builddir directory Where to put the built indexes\n";53 print STD ERR" -maxdocs number Maximum number of documents to build\n";54 print STD ERR" -debug Print output to STDOUT\n";55 print STD ERR" -mode all|compress_text|build_index|infodb\n";56 print STD ERR" -index indexname Index to build (will build all in\n";57 print STD ERR" config file if not set)\n";58 print STD ERR" -keepold will not destroy the current contents of the\n";59 print STD ERR" building directory\n";60 print STD ERR" -no_text Don't store compressed text. This option is\n";61 print STD ERR" useful for minimizing the size of the built\n";62 print STD ERR" indexes if you intend always to display the\n";63 print STD ERR" original documents at run time (i.e. you won't\n";64 print STD ERR" be able to retrieve the compressed text version)\n";65 print STD ERR" -allclassifications Don't remove empty classifications\n";66 print STD ERR" -create_images Attempt to create default images for new\n";67 print STD ERR" collection. This relies on the Gimp being\n";68 print STD ERR" installed along with relevant perl modules\n";69 print STD ERR" to allow scripting from perl\n";70 print STD ERR" -collectdir directory Collection directory (defaults to " .46 print STDOUT "\n"; 47 print STDOUT "buildcol.pl: Builds the indexes of a Greenstone collection.\n\n"; 48 print STDOUT " usage: $0 [options] collection-name\n\n"; 49 print STDOUT " options:\n"; 50 print STDOUT " -verbosity number 0=none, 3=lots\n"; 51 print STDOUT " -archivedir directory Where the archives live\n"; 52 print STDOUT " -builddir directory Where to put the built indexes\n"; 53 print STDOUT " -maxdocs number Maximum number of documents to build\n"; 54 print STDOUT " -debug Print output to STDOUT\n"; 55 print STDOUT " -mode all|compress_text|build_index|infodb\n"; 56 print STDOUT " -index indexname Index to build (will build all in\n"; 57 print STDOUT " config file if not set)\n"; 58 print STDOUT " -keepold will not destroy the current contents of the\n"; 59 print STDOUT " building directory\n"; 60 print STDOUT " -no_text Don't store compressed text. This option is\n"; 61 print STDOUT " useful for minimizing the size of the built\n"; 62 print STDOUT " indexes if you intend always to display the\n"; 63 print STDOUT " original documents at run time (i.e. you won't\n"; 64 print STDOUT " be able to retrieve the compressed text version)\n"; 65 print STDOUT " -allclassifications Don't remove empty classifications\n"; 66 print STDOUT " -create_images Attempt to create default images for new\n"; 67 print STDOUT " collection. This relies on the Gimp being\n"; 68 print STDOUT " installed along with relevant perl modules\n"; 69 print STDOUT " to allow scripting from perl\n"; 70 print STDOUT " -collectdir directory Collection directory (defaults to " . 71 71 &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n"; 72 print STDERR " -out Filename or handle to print output status to.\n"; 73 print STDERR " The default is STDERR\n"; 74 print STDERR " -buildtype mg|mgpp This will override the config file setting.\n"; 75 print STDERR " (default is mg)\n"; 76 print STDERR " -no_strip_html Do not strip the html tags from the indexed text\n"; 77 print STDERR " (only used for mgpp collections).\n\n"; 72 print STDOUT " -out Filename or handle to print output status to.\n"; 73 print STDOUT " The default is STDERR\n"; 74 print STDOUT " -buildtype mg|mgpp This will override the config file setting.\n"; 75 print STDOUT " (default is mg)\n"; 76 print STDOUT " -no_strip_html Do not strip the html tags from the indexed text\n"; 77 print STDOUT " (only used for mgpp collections).\n\n"; 78 print STDOUT " [Type \"perl -S buildcol.pl | more\" if this help text scrolled off your screen]"; 79 print STDOUT "\n" unless $ENV{'GSDLOS'} =~ /^windows$/i; 78 80 } 79 81 -
trunk/gsdl/bin/script/import.pl
r2355 r2359 48 48 49 49 sub print_usage { 50 print STD ERR"\n";51 print STD ERR"import.pl: Converts documents in collections -importdir directory into\n";52 print STD ERR" gml documents which are written to the -archivedir directory.\n\n";53 print STD ERR" usage: $0 [options] collection-name\n\n";54 print STD ERR" options:\n";55 print STD ERR" -verbosity number 0=none, 3=lots\n";56 print STD ERR" -importdir directory Where the original material lives\n";57 print STD ERR" -archivedir directory Where the converted material ends up\n";58 print STD ERR" -keepold Will not destroy the current contents of the\n";59 print STD ERR" archives directory (the default)\n";60 print STD ERR" -removeold Will remove the old contents of the archives\n";61 print STD ERR" directory -- use with care\n";62 print STD ERR" -gzip Use gzip to compress resulting gml documents\n";63 print STD ERR" (don't forget to include ZIPPlug in your plugin\n";64 print STD ERR" list when building from compressed documents)\n";65 print STD ERR" -maxdocs number Maximum number of documents to import\n";66 print STD ERR" -groupsize number Number of GML documents to group into one file\n";67 print STD ERR" -OIDtype hash|incremental The method to use when generating unique\n";68 print STD ERR" identifiers for each document. \"hash\" (the\n";69 print STD ERR" default) hashes the contents of the file and so\n";70 print STD ERR" will be the same every time the collection is\n";71 print STD ERR" imported. \"incremental\" is a simple document\n";72 print STD ERR" count and so will be significantly faster than\n";73 print STD ERR" \"hash\". It is not guaranteed to always assign\n";74 print STD ERR" the same identifier to a given document though\n";75 print STD ERR" and does not allow further documents to be added\n";76 print STD ERR" to existing gml archives\n";77 print STD ERR" -sortmeta metadata Sort documents alphabetically by metadata for\n";78 print STD ERR" building. This will be disabled if groupsize > 1\n";79 print STD ERR" -debug Print imported text to STDOUT\n";80 print STD ERR" -collectdir directory Collection directory (defaults to " .50 print STDOUT "\n"; 51 print STDOUT "import.pl: Converts documents in collections -importdir directory into\n"; 52 print STDOUT " gml documents which are written to the -archivedir directory.\n\n"; 53 print STDOUT " usage: $0 [options] collection-name\n\n"; 54 print STDOUT " options:\n"; 55 print STDOUT " -verbosity number 0=none, 3=lots\n"; 56 print STDOUT " -importdir directory Where the original material lives\n"; 57 print STDOUT " -archivedir directory Where the converted material ends up\n"; 58 print STDOUT " -keepold Will not destroy the current contents of the\n"; 59 print STDOUT " archives directory (the default)\n"; 60 print STDOUT " -removeold Will remove the old contents of the archives\n"; 61 print STDOUT " directory -- use with care\n"; 62 print STDOUT " -gzip Use gzip to compress resulting gml documents\n"; 63 print STDOUT " (don't forget to include ZIPPlug in your plugin\n"; 64 print STDOUT " list when building from compressed documents)\n"; 65 print STDOUT " -maxdocs number Maximum number of documents to import\n"; 66 print STDOUT " -groupsize number Number of GML documents to group into one file\n"; 67 print STDOUT " -OIDtype hash|incremental The method to use when generating unique\n"; 68 print STDOUT " identifiers for each document. \"hash\" (the\n"; 69 print STDOUT " default) hashes the contents of the file and so\n"; 70 print STDOUT " will be the same every time the collection is\n"; 71 print STDOUT " imported. \"incremental\" is a simple document\n"; 72 print STDOUT " count and so will be significantly faster than\n"; 73 print STDOUT " \"hash\". It is not guaranteed to always assign\n"; 74 print STDOUT " the same identifier to a given document though\n"; 75 print STDOUT " and does not allow further documents to be added\n"; 76 print STDOUT " to existing gml archives\n"; 77 print STDOUT " -sortmeta metadata Sort documents alphabetically by metadata for\n"; 78 print STDOUT " building. This will be disabled if groupsize > 1\n"; 79 print STDOUT " -debug Print imported text to STDOUT\n"; 80 print STDOUT " -collectdir directory Collection directory (defaults to " . 81 81 &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n"; 82 print STDERR " -out Filename or handle to print output status to.\n"; 83 print STDERR " The default is STDERR\n\n"; 82 print STDOUT " -out Filename or handle to print output status to.\n"; 83 print STDOUT " The default is STDERR\n\n"; 84 print STDOUT " [Type \"perl -S import.pl | more\" if this help text scrolled off your screen]"; 85 print STDOUT "\n" unless $ENV{'GSDLOS'} =~ /^windows$/i; 84 86 } 85 87 -
trunk/gsdl/bin/script/mkcol.pl
r1993 r2359 35 35 BEGIN { 36 36 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 37 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'}; 37 38 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 38 39 } … … 43 44 44 45 sub print_usage { 45 print STD ERR"\n";46 print STD ERR"mkcol.pl: Creates the directory structure for a new\n";47 print STD ERR" Greenstone collection.\n\n";48 print STD ERR " usage: $0 [options]collection-name\n\n";49 print STD ERR" options:\n";50 print STD ERR" -optionfile file Get options from file, useful on systems where\n";51 print STD ERR" long command lines may cause problems\n";52 print STD ERR" -collectdir Directory where new collection will be created.\n";53 print STD ERR" Default is " .46 print STDOUT "\n"; 47 print STDOUT "mkcol.pl: Creates the directory structure for a new\n"; 48 print STDOUT " Greenstone collection.\n\n"; 49 print STDOUT " usage: $0 -creator [options] email collection-name\n\n"; 50 print STDOUT " options:\n"; 51 print STDOUT " -optionfile file Get options from file, useful on systems where\n"; 52 print STDOUT " long command lines may cause problems\n"; 53 print STDOUT " -collectdir Directory where new collection will be created.\n"; 54 print STDOUT " Default is " . 54 55 &util::filename_cat($ENV{'GSDLHOME'}, "collect") . "\n"; 55 print STD ERR " -creator email Your email address\n";56 print STD ERR " -maintainer email The collection maintainer's email address (if\n";57 print STD ERR " different from the creator)\n";58 print STD ERR " -public true|false If this collection has anonymous access\n";59 print STD ERR " -beta true|false If this collection is still under development\n";60 print STD ERR " -title text The titlefor the collection\n";61 print STD ERR " -about text The about text for the collection\n";62 print STD ERR " -plugin text perl plugin module to use (there may be multiple\n";63 print STD ERR " plugin entries)\n";64 print STD ERR " Note that -creator is the only option to mkcol.pl that is mandatory.\n";65 print STD ERR " You can make changes to all options later by editing the collect.cfg\n";66 print STD ERR " configuration file for your new collection (it'll be in the \"etc\"\n";67 print STD ERR " directory).\n\n";56 print STDOUT " -maintainer email The collection maintainer's email address (if\n"; 57 print STDOUT " different from the creator)\n"; 58 print STDOUT " -public true|false If this collection has anonymous access\n"; 59 print STDOUT " -beta true|false If this collection is still under development\n"; 60 print STDOUT " -title text The title for the collection\n"; 61 print STDOUT " -about text The about text for the collection\n"; 62 print STDOUT " -plugin text perl plugin module to use (there may be multiple\n"; 63 print STDOUT " plugin entries)\n"; 64 print STDOUT " Note that -creator must be specified. You can make changes to all\n"; 65 print STDOUT " options later by editing the collect.cfg configuration file for your\n"; 66 print STDOUT " new collection (it'll be in the \"etc\" directory).\n\n"; 67 print STDOUT " [Type \"perl -S mkcol.pl | more\" if this help text scrolled off your screen]"; 68 print STDOUT "\n" unless $ENV{'GSDLOS'} =~ /^windows$/i; 68 69 } 69 70 … … 102 103 $destfile = &util::filename_cat ($coldir, $destfile); 103 104 104 print STD ERR"doing replacements for $thisfile\n";105 print STDOUT "doing replacements for $thisfile\n"; 105 106 open (INFILE, $thisfile) || 106 107 die "Can't read file $thisfile"; … … 170 171 ($collection) = @ARGV; 171 172 if (!defined($collection)) { 172 print STD ERR"no collection name was specified\n";173 print STDOUT "no collection name was specified\n"; 173 174 &print_usage(); 174 175 die "\n"; … … 176 177 177 178 if (length($collection) > 8) { 178 print STD ERR"The collection name must be less than 8 characters\n";179 print STD ERR"so compatibility with earlier filesystems can be\n";180 print STD ERR"maintained.\n";179 print STDOUT "The collection name must be less than 8 characters\n"; 180 print STDOUT "so compatibility with earlier filesystems can be\n"; 181 print STDOUT "maintained.\n"; 181 182 die "\n"; 182 183 } 183 184 184 185 if ($collection eq "modelcol") { 185 print STD ERR"No collection can be named modelcol as this is the\n";186 print STD ERR"name of the model collection.\n";186 print STDOUT "No collection can be named modelcol as this is the\n"; 187 print STDOUT "name of the model collection.\n"; 187 188 die "\n"; 188 189 } 189 190 190 191 if ($collection eq "CVS") { 191 print STD ERR"No collection can be named CVS as this may interfere\n";192 print STD ERR"with directories created by the CVS versioning system\n";192 print STDOUT "No collection can be named CVS as this may interfere\n"; 193 print STDOUT "with directories created by the CVS versioning system\n"; 193 194 die "\n"; 194 195 } 195 196 196 197 if (!defined($creator) || $creator eq "") { 197 print STD ERR"The creator was not defined. This variable is\n";198 print STD ERR"needed to recognise duplicate collection names.\n";198 print STDOUT "The creator was not defined. This variable is\n"; 199 print STDOUT "needed to recognise duplicate collection names.\n"; 199 200 die "\n"; 200 201 } … … 224 225 if (defined $collectdir && $collectdir =~ /\w/) { 225 226 if (!-d $collectdir) { 226 print STD ERR"ERROR: $collectdir doesn't exist\n";227 print STDOUT "ERROR: $collectdir doesn't exist\n"; 227 228 die "\n"; 228 229 } … … 237 238 # make sure this collection does not already exist 238 239 if (-e $cdir) { 239 print STD ERR"This collection already exists\n";240 print STDOUT "This collection already exists\n"; 240 241 die "\n"; 241 242 } 242 243 243 244 # start creating the collection 244 print STD ERR"Creating the collection $collection\n";245 print STDOUT "Creating the collection $collection\n"; 245 246 &traverse_dir ($mdir, $cdir); 246 print STD ERR"The new collection is in $cdir.\n";247 print STDOUT "The new collection is in $cdir.\n"; 247 248 } 248 249 -
trunk/gsdl/perllib/parsargv.pm
r1954 r2359 151 151 elsif (!$allow_extra_options) 152 152 { 153 print STD ERR"$arg is not a valid option.\n";153 print STDOUT "$arg is not a valid option.\n"; 154 154 $errors++; 155 155 } … … 176 176 elsif (ref($option{$arg}->{'varref'}) ne 'ARRAY') 177 177 { 178 print STD ERR"Missing command line argument -$arg.\n";178 print STDOUT "Missing command line argument -$arg.\n"; 179 179 $errors++; 180 180 } … … 196 196 else 197 197 { 198 print STD ERR"Bad value for -$option->{'name'} argument.\n";198 print STDOUT "Bad value for -$option->{'name'} argument.\n"; 199 199 $$errors++; 200 200 } … … 206 206 else 207 207 { 208 print STD ERR"No value given for -$option->{'name'}.\n";208 print STDOUT "No value given for -$option->{'name'}.\n"; 209 209 $$errors++; 210 210 } -
trunk/gsdl/perllib/util.pm
r2193 r2359 566 566 $collection = $ENV{'GSDLCOLLECTION'}; 567 567 } else { 568 print STD ERR"No collection specified\n";568 print STDOUT "No collection specified\n"; 569 569 return ""; 570 570 } … … 572 572 573 573 if ($collection eq "modelcol") { 574 print STD ERR"You can't use modelcol.\n";574 print STDOUT "You can't use modelcol.\n"; 575 575 return ""; 576 576 } … … 583 583 # make sure this collection exists 584 584 if (!-e $ENV{'GSDLCOLLECTDIR'}) { 585 print STD ERR"Invalid collection ($collection).\n";585 print STDOUT "Invalid collection ($collection).\n"; 586 586 return ""; 587 587 }
Note:
See TracChangeset
for help on using the changeset viewer.