Changeset 23218

Show
Ignore:
Timestamp:
27.10.2010 10:47:36 (9 years ago)
Author:
kjdon
Message:

fixed up -manifest use with this script. -manifest needs -keepold instead of -incremental

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/incremental-import.pl

    r23168 r23218  
    6868    my $archive_dir  = undef; 
    6969    my $site = undef; 
     70    my $manifest = undef; 
    7071 
    7172    while (my $arg = shift @argv) { 
     
    8586        $site = shift @argv; 
    8687        push(@filtered_argv,$arg,$site); 
     88    } 
     89    elsif ($arg eq "-manifest") { 
     90        $manifest = shift @argv; 
     91        push(@filtered_argv,$arg,$manifest); 
    8792    } 
    8893    else { 
     
    136141    } 
    137142 
    138     if (-e $archiveinf_doc_file_path) { 
    139     $import_cmd .= " -incremental"; 
    140      
     143    if (defined $manifest) { 
     144    # manifest files need -keepold not -incremental 
     145    $import_cmd .= " -keepold"; 
     146    } else { 
     147    if (-e $archiveinf_doc_file_path) { 
     148        $import_cmd .= " -incremental"; 
     149         
     150    } 
     151    else { 
     152        print STDERR "*****\n"; 
     153        print STDERR "First time import. Switching to full import.pl.\n"; 
     154        print STDERR "*****\n"; 
     155        $import_cmd .= " -removeold"; 
     156    } 
    141157    } 
    142     else { 
    143     print STDERR "*****\n"; 
    144     print STDERR "First time import. Switching to full import.pl.\n"; 
    145     print STDERR "*****\n"; 
    146     $import_cmd .= " -removeold"; 
    147     } 
    148  
    149158    $import_cmd .= " $quoted_argv \"$collection\""; 
    150159