[25573] | 1 | #!/usr/bin/perl -w
|
---|
| 2 |
|
---|
| 3 | ###########################################################################
|
---|
| 4 | #
|
---|
| 5 | # activate.pl -- to be called after building a collection to activate it.
|
---|
| 6 | #
|
---|
| 7 | # A component of the Greenstone digital library software
|
---|
| 8 | # from the New Zealand Digital Library Project at the
|
---|
| 9 | # University of Waikato, New Zealand.
|
---|
| 10 | #
|
---|
| 11 | # Copyright (C) 2009 New Zealand Digital Library Project
|
---|
| 12 | #
|
---|
| 13 | # This program is free software; you can redistribute it and/or modify
|
---|
| 14 | # it under the terms of the GNU General Public License as published by
|
---|
| 15 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 16 | # (at your option) any later version.
|
---|
| 17 | #
|
---|
| 18 | # This program is distributed in the hope that it will be useful,
|
---|
| 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 21 | # GNU General Public License for more details.
|
---|
| 22 | #
|
---|
| 23 | # You should have received a copy of the GNU General Public License
|
---|
| 24 | # along with this program; if not, write to the Free Software
|
---|
| 25 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 26 | #
|
---|
| 27 | ###########################################################################
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | # This program is designed to support the building process of Greenstone.
|
---|
| 31 | # It deactivates the collection just built, if the web server is running
|
---|
| 32 | # and is a persistent web server (or if the library_URL provided as
|
---|
| 33 | # parameter to this script is of a currently running web server). It then
|
---|
| 34 | # moves building to index, before activating the collection on the GS2 or
|
---|
| 35 | # GS3 web server again if necessary.
|
---|
| 36 |
|
---|
[27240] | 37 | use Config;
|
---|
[25573] | 38 |
|
---|
| 39 | BEGIN {
|
---|
| 40 | die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
|
---|
| 41 | die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
|
---|
| 42 | unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
|
---|
[27175] | 43 | unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
|
---|
[27240] | 44 |
|
---|
[30513] | 45 | # Adding cpan in, adds in its auto subfolder which conflicts with ActivePerl on Windows
|
---|
| 46 | # The auto folder has been moved into a perl-5.8 folder, and this will now be included
|
---|
| 47 | # only if the current version of perl is 5.8 (and not ActivePerl).
|
---|
| 48 | my $perl_dir;
|
---|
[27240] | 49 |
|
---|
| 50 | # Note: $] encodes the version number of perl
|
---|
| 51 | if ($]>=5.010) {
|
---|
| 52 | $perl_dir="perl-5.".substr($],3,2);
|
---|
| 53 | }
|
---|
| 54 | elsif ($]>5.008) {
|
---|
| 55 | # perl 5.8.1 or above
|
---|
| 56 | $perl_dir = "perl-5.8";
|
---|
| 57 | }
|
---|
| 58 | elsif ($]>=5.008) {
|
---|
| 59 | # perl 5.8.1 or above
|
---|
| 60 | $perl_dir = "perl-5.8";
|
---|
| 61 | }
|
---|
| 62 | elsif ($]<5.008) {
|
---|
| 63 | # assume perl 5.6
|
---|
| 64 | $perl_dir = "perl-5.6";
|
---|
| 65 | }
|
---|
| 66 | else {
|
---|
| 67 | print STDERR "Warning: Perl 5.8.0 is not a maintained release.\n";
|
---|
| 68 | print STDERR " Please upgrade to a newer version of Perl.\n";
|
---|
| 69 | $perl_dir = "perl-5.8";
|
---|
| 70 | }
|
---|
[30513] | 71 |
|
---|
[27240] | 72 | #if ($ENV{'GSDLOS'} !~ /^windows$/i) {
|
---|
[30513] | 73 | # Use push to put this on the end, so an existing XML::Parser will be used by default
|
---|
[27240] | 74 | if (-d "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir-mt" && $Config{usethreads}){
|
---|
| 75 | push (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir-mt");
|
---|
| 76 | }
|
---|
| 77 | else{
|
---|
| 78 | push (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir");
|
---|
| 79 | }
|
---|
| 80 | #}
|
---|
| 81 |
|
---|
[25573] | 82 | }
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | use strict;
|
---|
| 86 | no strict 'refs'; # allow filehandles to be variables and vice versa
|
---|
| 87 | no strict 'subs'; # allow barewords (eg STDERR) as function arguments
|
---|
| 88 |
|
---|
| 89 | use File::Basename;
|
---|
| 90 | use File::Find;
|
---|
| 91 |
|
---|
[30520] | 92 | # Greenstone modules
|
---|
[25573] | 93 | use colcfg;
|
---|
| 94 | use scriptutil;
|
---|
[30523] | 95 | use servercontrol;
|
---|
[25573] | 96 | use util;
|
---|
| 97 |
|
---|
| 98 |
|
---|
| 99 | # Most of the arguments are familiar from the building scripts like buildcol.pl
|
---|
| 100 | # The special optional argument -library_url is for when we're dealing with a web
|
---|
| 101 | # library server such as an apache that's separate from any included with GS2.
|
---|
| 102 | # In such a case, this script's caller should pass in -library_url <URL>.
|
---|
| 103 | #
|
---|
| 104 | # $site argument must be specified in the cmdline for collectionConfig.xml to get
|
---|
| 105 | # generated which makes $gs_mode=gs3, else collect.cfg gets generated and $gs_mode=gs2
|
---|
| 106 | sub main
|
---|
| 107 | {
|
---|
| 108 | my ($argc,@argv) = @_;
|
---|
| 109 |
|
---|
| 110 | if (($argc==0) || (($argc==1) && ($argv[0] =~ m/^--?h(elp)?$/))) {
|
---|
[30513] | 111 | my ($progname) = ($0 =~ m/^.*[\/|\\](.*?)$/);
|
---|
| 112 |
|
---|
| 113 |
|
---|
| 114 | print STDERR "\n";
|
---|
[30524] | 115 | print STDERR "Usage: $progname [-collectdir c -builddir b -indexdir i -site s -skipactivation -removeold -keepold -incremental -verbosity v\n";
|
---|
[30513] | 116 | print STDERR "\t-library_url URL -library_name n] <[colgroup/]collection>\n";
|
---|
| 117 | print STDERR "\n";
|
---|
| 118 |
|
---|
| 119 | exit(-1);
|
---|
[25573] | 120 | }
|
---|
[30517] | 121 |
|
---|
| 122 | # http://stackoverflow.com/questions/6156742/how-can-i-capture-the-complete-commandline-in-perl
|
---|
[30520] | 123 | #print STDERR "@@@@@@@@@ ACTIVATE CMD: " . join " ", $0, @ARGV . "\n";
|
---|
[25573] | 124 |
|
---|
[30513] | 125 | # get the collection details
|
---|
[25573] | 126 | my $qualified_collection = pop @argv; # qualified collection
|
---|
[30513] | 127 |
|
---|
[25796] | 128 | my $collect_dir = undef; #"collect"; # can't be "collect" when only -site is provided for GS3
|
---|
[25573] | 129 | my $build_dir = undef;
|
---|
[30513] | 130 | my $index_dir = undef;
|
---|
| 131 | my $site = undef;
|
---|
| 132 |
|
---|
| 133 | # if run from server (java code), it will handle deactivation and activation to prevent open file handles when java launches this script and exits:
|
---|
| 134 | my $skipactivation = 0;
|
---|
| 135 | my $removeold = 0;
|
---|
| 136 | my $keepold = 0;
|
---|
| 137 | my $incremental = 0; # used by solr
|
---|
[30517] | 138 |
|
---|
[30520] | 139 | my $default_verbosity = 2;
|
---|
[30517] | 140 |
|
---|
[30520] | 141 | my $library_url = undef; # to be specified on the cmdline if not using a GS-included web server
|
---|
[30513] | 142 | # the GSDL_LIBRARY_URL env var is useful when running cmdline buildcol.pl in the linux package manager versions of GS3
|
---|
| 143 |
|
---|
[29983] | 144 | my $library_name = undef;
|
---|
[30513] | 145 |
|
---|
[25573] | 146 | while (my $arg = shift @argv) {
|
---|
[30513] | 147 | if ($arg eq "-collectdir") {
|
---|
| 148 | $collect_dir = shift @argv;
|
---|
| 149 | }
|
---|
| 150 | elsif ($arg eq "-builddir") {
|
---|
| 151 | $build_dir = shift @argv;
|
---|
| 152 | }
|
---|
| 153 | elsif ($arg eq "-indexdir") {
|
---|
| 154 | $index_dir = shift @argv;
|
---|
| 155 | }
|
---|
| 156 | elsif ($arg eq "-site") {
|
---|
| 157 | $site = shift @argv;
|
---|
| 158 | }
|
---|
| 159 | elsif ($arg eq "-skipactivation") {
|
---|
| 160 | $skipactivation = 1;
|
---|
| 161 | }
|
---|
| 162 | elsif ($arg eq "-removeold") {
|
---|
| 163 | $removeold = 1;
|
---|
| 164 | }
|
---|
| 165 | elsif ($arg eq "-keepold") {
|
---|
| 166 | $keepold = 1;
|
---|
| 167 | }
|
---|
| 168 | elsif ($arg eq "-incremental") {
|
---|
| 169 | $incremental = 1;
|
---|
| 170 | }
|
---|
| 171 | elsif ($arg eq "-library_url") {
|
---|
| 172 | $library_url = shift @argv;
|
---|
| 173 | }
|
---|
| 174 | elsif ($arg eq "-library_name") {
|
---|
| 175 | $library_name = shift @argv;
|
---|
| 176 | }
|
---|
| 177 | elsif ($arg eq "-verbosity") {
|
---|
| 178 | $default_verbosity = shift @argv; # global variable
|
---|
| 179 |
|
---|
| 180 | # ensure we're working with ints not strings (int context not str context), in case verbosity=0
|
---|
| 181 | # http://stackoverflow.com/questions/288900/how-can-i-convert-a-string-to-a-number-in-perl
|
---|
| 182 | $default_verbosity = int($default_verbosity || 0); ### is this the best way?
|
---|
| 183 | }
|
---|
[25573] | 184 | }
|
---|
[25896] | 185 |
|
---|
[30513] | 186 | # work out the building and index dirs
|
---|
| 187 | my $collection_dir = &util::resolve_collection_dir($collect_dir, $qualified_collection, $site);
|
---|
| 188 | $build_dir = &FileUtils::filenameConcatenate($collection_dir, "building") unless (defined $build_dir);
|
---|
| 189 | $index_dir = &FileUtils::filenameConcatenate($collection_dir, "index") unless (defined $index_dir);
|
---|
[30520] | 190 |
|
---|
[30523] | 191 | my $gsserver = new servercontrol($qualified_collection, $site, $default_verbosity, $build_dir, $index_dir, $collect_dir, $library_url, $library_name);
|
---|
[30520] | 192 |
|
---|
| 193 | $gsserver->print_task_msg("Running Collection Activation Stage");
|
---|
[30513] | 194 |
|
---|
[25573] | 195 | # get and check the collection name
|
---|
| 196 | if ((&colcfg::use_collection($site, $qualified_collection, $collect_dir)) eq "") {
|
---|
[30520] | 197 | $gsserver->print_msg("Unable to use collection \"$qualified_collection\" within \"$collect_dir\"\n");
|
---|
[30513] | 198 | exit -1;
|
---|
[25573] | 199 | }
|
---|
[30513] | 200 |
|
---|
[25573] | 201 | # Read in the collection configuration file.
|
---|
[25887] | 202 | # Beware: Only if $site is specified in the cmdline does collectionConfig.xml get
|
---|
| 203 | # generated and does $gs_mode=gs3, else collect.cfg gets generated and $gs_mode=gs2
|
---|
[30520] | 204 | my $gs_mode = $gsserver->{'gs_mode'}; # "gs2" or "gs3", based on $site variable
|
---|
| 205 |
|
---|
[26567] | 206 | my $collect_cfg_filename = &colcfg::get_collect_cfg_name(STDERR, $gs_mode);
|
---|
[25573] | 207 | my $collectcfg = &colcfg::read_collection_cfg ($collect_cfg_filename,$gs_mode);
|
---|
[30513] | 208 |
|
---|
[25573] | 209 | # look for build.cfg/buildConfig.xml
|
---|
| 210 | my $build_cfg_filename ="";
|
---|
[30513] | 211 |
|
---|
[25573] | 212 | if ($gs_mode eq "gs2") {
|
---|
[30513] | 213 | $build_cfg_filename = &FileUtils::filenameConcatenate($build_dir,"build.cfg");
|
---|
[25573] | 214 | } else {
|
---|
[30513] | 215 | $build_cfg_filename = &FileUtils::filenameConcatenate($build_dir, "buildConfig.xml");
|
---|
| 216 | # gs_mode is GS3. Set the site now if this was not specified as cmdline argument
|
---|
| 217 | #$site = "localsite" unless defined $site;
|
---|
[25573] | 218 | }
|
---|
[30513] | 219 |
|
---|
[25887] | 220 | # We need to know the buildtype for Solr.
|
---|
| 221 | # Any change of indexers is already detected and handled by the calling code (buildcol or
|
---|
| 222 | # full-rebuild), so that at this stage the config file's buildtype reflects the actual buildtype.
|
---|
[30513] | 223 |
|
---|
[25887] | 224 | # From buildcol.pl we use searchtype for determining buildtype, but for old versions, use buildtype
|
---|
| 225 | my $buildtype;
|
---|
| 226 | if (defined $collectcfg->{'buildtype'}) {
|
---|
| 227 | $buildtype = $collectcfg->{'buildtype'};
|
---|
| 228 | } elsif (defined $collectcfg->{'searchtypes'} || defined $collectcfg->{'searchtype'}) {
|
---|
| 229 | $buildtype = "mgpp";
|
---|
| 230 | } else {
|
---|
| 231 | $buildtype = "mg"; #mg is the default
|
---|
[30499] | 232 | }
|
---|
[25896] | 233 |
|
---|
| 234 | # can't do anything without a build directory with something in it to move into index
|
---|
| 235 | # Except if we're (doing incremental) building for solr, where we want to still
|
---|
| 236 | # activate and deactivate collections including for the incremental case
|
---|
[27325] | 237 | if(!&FileUtils::directoryExists($build_dir)) {
|
---|
[30520] | 238 | $gsserver->print_msg("No building folder at $build_dir to move to index.\n");
|
---|
[25896] | 239 | exit -1 unless ($buildtype eq "solr"); #&& $incremental);
|
---|
[27325] | 240 | } elsif (&FileUtils::isDirectoryEmpty($build_dir)) {
|
---|
[30520] | 241 | $gsserver->print_msg("Nothing in building folder $build_dir to move into index folder.\n");
|
---|
[25896] | 242 | exit -1 unless ($buildtype eq "solr"); #&& $incremental);
|
---|
[25573] | 243 | }
|
---|
[25896] | 244 |
|
---|
[30513] | 245 | # Now the logic in GLI's CollectionManager.java (processComplete()
|
---|
| 246 | # and installCollection()) and Gatherer.configGS3Server().
|
---|
| 247 |
|
---|
| 248 | # 1. Get library URL
|
---|
[30524] | 249 | # CollectionManager's installCollection phase in GLI:
|
---|
| 250 | # 2. Ping the library URL, and if it's a persistent server and running, release the collection
|
---|
| 251 | $gsserver->do_deactivate() unless $skipactivation;
|
---|
[30517] | 252 |
|
---|
[29220] | 253 | # 2b. If we're working with a solr collection, then start up the solrserver now.
|
---|
| 254 | my $solr_server;
|
---|
| 255 | my @corenames = ();
|
---|
| 256 | if($buildtype eq "solr") { # start up the jetty server
|
---|
| 257 | my $solr_ext = $ENV{'GEXT_SOLR'}; # from solr_passes.pl
|
---|
| 258 | unshift (@INC, "$solr_ext/perllib");
|
---|
| 259 | require solrserver;
|
---|
| 260 |
|
---|
| 261 | # Solr cores are named without taking the collection-group name into account, since solr
|
---|
| 262 | # is used for GS3 and GS3 doesn't use collection groups but has the site concept instead
|
---|
| 263 | my ($colname, $colgroup) = &util::get_collection_parts($qualified_collection);
|
---|
| 264 |
|
---|
| 265 | # See solrbuilder.pm to get the indexing levels (document, section) from the collectcfg file
|
---|
| 266 | # Used to generate core names from them and remove cores by name
|
---|
| 267 | foreach my $level ( @{$collectcfg->{'levels'}} ){
|
---|
| 268 | my ($pindex) = $level =~ /^(.)/;
|
---|
| 269 | my $indexname = $pindex."idx";
|
---|
| 270 | push(@corenames, "$site-$colname-$indexname"); #"$site-$colname-didx", "$site-$colname-sidx"
|
---|
| 271 | }
|
---|
[25581] | 272 |
|
---|
[29220] | 273 | # If the Solr/Jetty server is not already running, the following starts
|
---|
| 274 | # it up, and only returns when the server is "reading and listening"
|
---|
| 275 | $solr_server = new solrserver($build_dir);
|
---|
| 276 | $solr_server->start();
|
---|
[30513] | 277 |
|
---|
[29220] | 278 | # We'll be moving building to index. For solr collection, there's further
|
---|
| 279 | # special processing to make a corresponding change to the solr.xml
|
---|
| 280 | # by removing the temporary building cores and (re)creating the index cores
|
---|
| 281 | }
|
---|
| 282 |
|
---|
| 283 |
|
---|
[30513] | 284 | # 3. Do all the moving building to index stuff now
|
---|
| 285 |
|
---|
| 286 | # If removeold: replace index dir with building dir.
|
---|
| 287 | # If keepold: move building's contents into index, where only duplicates will get deleted.
|
---|
| 288 | # removeold and keepold can't both be on at the same time
|
---|
| 289 | # incremental becomes relevant for solr, though it was irrelevant to what activate.pl does (moving building to index)
|
---|
| 290 | my $incremental_mode;
|
---|
| 291 | ($removeold, $keepold, $incremental, $incremental_mode) = &scriptutil::check_removeold_and_keepold($removeold, $keepold,
|
---|
[25892] | 292 | $incremental,
|
---|
[25573] | 293 | $build_dir, # checkdir. Usually archives or export to be deleted. activate.pl deletes building
|
---|
| 294 | $collectcfg);
|
---|
| 295 |
|
---|
[30513] | 296 | if($removeold) {
|
---|
| 297 |
|
---|
| 298 | if(&FileUtils::directoryExists($index_dir)) {
|
---|
[30520] | 299 | $gsserver->print_task_msg("Removing \"index\"");
|
---|
[25887] | 300 |
|
---|
[30513] | 301 | if ($buildtype eq "solr") {
|
---|
| 302 | # if solr, remove any cores that are using the index_dir before deleting this dir
|
---|
| 303 | foreach my $corename (@corenames) {
|
---|
| 304 | $solr_server->admin_unload_core($corename);
|
---|
[25573] | 305 | }
|
---|
[30513] | 306 | }
|
---|
[25888] | 307 |
|
---|
[30513] | 308 | &FileUtils::removeFilesRecursive($index_dir);
|
---|
| 309 |
|
---|
| 310 | # Wait for a couple of seconds, just for luck
|
---|
| 311 | sleep 2;
|
---|
| 312 |
|
---|
| 313 | if (&FileUtils::directoryExists($index_dir)) {
|
---|
[30520] | 314 | $gsserver->print_msg("The index directory $index_dir could not be deleted.\n"); # CollectionManager.Index_Not_Deleted
|
---|
[30513] | 315 | }
|
---|
[25573] | 316 | }
|
---|
[30513] | 317 |
|
---|
| 318 | # if remote GS server: gliserver.pl would call activate.pl to activate
|
---|
| 319 | # the collection at this point since activate.pl lives on the server side
|
---|
| 320 |
|
---|
| 321 | if ($buildtype eq "solr") {
|
---|
| 322 | # if solr, remove any cores that are using the building_dir before moving this dir onto index
|
---|
| 323 | foreach my $corename (@corenames) {
|
---|
| 324 | $solr_server->admin_unload_core("building-$corename");
|
---|
| 325 | }
|
---|
| 326 | }
|
---|
| 327 |
|
---|
| 328 | # Move the building directory to become the new index directory
|
---|
[30520] | 329 | $gsserver->print_task_msg("Moving \"building\" -> \"index\"");
|
---|
[30513] | 330 | &FileUtils::moveFiles($build_dir, $index_dir);
|
---|
| 331 | if(&FileUtils::directoryExists($build_dir) || !&FileUtils::directoryExists($index_dir)) {
|
---|
[30520] | 332 | $gsserver->print_msg("Could not move $build_dir to $index_dir.\n"); # CollectionManager.Build_Not_Moved
|
---|
[30513] | 333 | }
|
---|
| 334 | }
|
---|
| 335 | elsif ($keepold || $incremental) {
|
---|
[30527] | 336 | if ($buildtype eq "solr" && $build_dir ne $index_dir) {
|
---|
[30513] | 337 | # if solr, remove any cores that may be using the building_dir before moving this dir onto index
|
---|
| 338 | foreach my $corename (@corenames) {
|
---|
| 339 | $solr_server->admin_unload_core("building-$corename") if $solr_server->admin_ping_core("building-$corename");
|
---|
| 340 | }
|
---|
| 341 | }
|
---|
| 342 |
|
---|
| 343 | if($build_dir eq $index_dir) { # building_dir can have been set to "index" folder, see incremental-buildcol.pl
|
---|
[30520] | 344 | $gsserver->print_task_msg("building folder is index folder, not moving");
|
---|
[30513] | 345 | } else {
|
---|
| 346 | # Copy just the contents of building dir into the index dir, overwriting
|
---|
| 347 | # existing files, but don't replace index with building.
|
---|
[30520] | 348 | $gsserver->print_task_msg("Moving \"building\" -> \"index\"");
|
---|
[30513] | 349 | &FileUtils::moveDirectoryContents($build_dir, $index_dir);
|
---|
| 350 | }
|
---|
| 351 | }
|
---|
| 352 |
|
---|
[25888] | 353 | if ($buildtype eq "solr") {
|
---|
[25892] | 354 | # Call CREATE action to get the old cores pointing to the index folder
|
---|
[25888] | 355 | foreach my $corename (@corenames) {
|
---|
[25889] | 356 | if($removeold) {
|
---|
[25892] | 357 | # Call CREATE action to get all cores pointing to the index folder, since building is now index
|
---|
[25889] | 358 | $solr_server->admin_create_core($corename, $index_dir);
|
---|
[25892] | 359 |
|
---|
| 360 | } elsif ($keepold || $incremental) {
|
---|
| 361 | # Call RELOAD core. Should already be using the index_dir directory for $keepold and $incremental case
|
---|
| 362 |
|
---|
| 363 | # Ping to see if corename exists, if it does, reload, else create
|
---|
| 364 | if ($solr_server->admin_ping_core($corename)) {
|
---|
| 365 | $solr_server->admin_reload_core($corename);
|
---|
| 366 | } else {
|
---|
| 367 | $solr_server->admin_create_core($corename, $index_dir);
|
---|
| 368 | }
|
---|
[25889] | 369 | }
|
---|
[25888] | 370 | }
|
---|
[30513] | 371 |
|
---|
[28185] | 372 | # regenerate the solr.xml.in from solr.xml in case we are working off a dvd.
|
---|
| 373 | $solr_server->solr_xml_to_solr_xml_in();
|
---|
[25888] | 374 | }
|
---|
[30520] | 375 |
|
---|
[30513] | 376 |
|
---|
[30524] | 377 | # 4. Ping the library URL, and if it's a persistent server and running, activate the collection again
|
---|
[30513] | 378 |
|
---|
| 379 | # Check for success: if building does not exist OR is empty OR if building is index (in which case there was no move)
|
---|
| 380 | if($build_dir eq $index_dir || !&FileUtils::directoryExists($build_dir) || &FileUtils::isDirectoryEmpty($build_dir)) {
|
---|
[25573] | 381 |
|
---|
[30524] | 382 | $gsserver->do_activate() unless $skipactivation;
|
---|
| 383 |
|
---|
[30513] | 384 | } else { # installcollection failed
|
---|
| 385 | #CollectionManager.Preview_Ready_Failed
|
---|
[30520] | 386 | $gsserver->print_msg("Building directory is not empty or still exists. Failed to properly move $build_dir to $index_dir.\n");
|
---|
[30513] | 387 | }
|
---|
| 388 |
|
---|
[30520] | 389 | $gsserver->print_msg("\n");
|
---|
[30513] | 390 |
|
---|
[30520] | 391 | if($buildtype eq "solr") {
|
---|
[25888] | 392 | if ($solr_server->explicitly_started()) {
|
---|
| 393 | $solr_server->stop();
|
---|
| 394 | }
|
---|
| 395 | }
|
---|
[25573] | 396 | }
|
---|
| 397 |
|
---|
| 398 | &main(scalar(@ARGV),@ARGV);
|
---|