Skip to content
Snippets Groups Projects
Commit 320611a0 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Do not decompress gzipped files (new default behaviour).

To force decompression, use 'xref_parser.pl' with the new '-unzip'
command line switch.

Removed '-compressed' command line switch.
parent 74770e1c
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ my (
$user, $pass, $create,
$release, $cleanup, $deletedownloaded,
$skipdownload, $drop_db, $checkdownload,
$dl_path, $compressed
$dl_path, $unzip
);
# --------------------------------------------------------------------------------
......@@ -46,7 +46,7 @@ sub run
my $sourcesr, $skipdownload, $checkdownload,
$create, $release, $cleanup,
$drop_db, $deletedownloaded, $dl_path,
my $notsourcesr, $compressed
my $notsourcesr, $unzip
) = @_;
$base_dir = $dl_path if $dl_path;
......@@ -207,7 +207,7 @@ sub run
if ($checkdownload) {
my $check_file = $dir . '/' . $file;
if ( !$compressed ) { $check_file =~ s/\.(gz|Z)$// }
if ($unzip) { $check_file =~ s/\.(gz|Z)$// }
print "Checking for file '$check_file'\n";
......@@ -217,7 +217,7 @@ sub run
$skipdownload = 1;
if ( !$compressed ) { $file =~ s/\.(gz|Z)$// }
if (!$unzip ) { $file =~ s/\.(gz|Z)$// }
} else {
print "File '$check_file' does not exist.\n"
. "Scheduling '$dir/$file' for download...\n";
......@@ -279,7 +279,7 @@ sub run
# automatically uncompressed it (it shouldn't have, is this an
# historical artifact? (ak)).
if ( !$compressed && ( $file =~ /\.(gz|Z)$/ ) ) {
if ( $unzip && ( $file =~ /\.(gz|Z)$/ ) ) {
print "Uncompressing '$dir/$file' using 'gunzip'\n";
system( "gunzip", "-f", $dir . '/' . $file );
}
......@@ -291,10 +291,10 @@ sub run
}
}
if ( !$compressed ) {
$file =~ s/\.(gz|Z)$//; # If skipdownload set this will
# not have been done yet.
# If it has, no harm done
if ($unzip) {
$file =~ s/\.(gz|Z)$//; # If skipdownload set this will
# not have been done yet.
# If it has, no harm done
}
if ($file_from_archive) {
......
......@@ -9,9 +9,11 @@ my (
@sources, $skipdownload, $checkdownload,
$create, $release, $cleanup,
$drop_existing_db, $deletedownloaded, $dl_path,
@notsource, $compressed
@notsource, $unzip
);
$unzip = 0; # Do not decompress gzipped files by default
GetOptions(
'dbuser|user=s' => \$user,
'dbpass|pass=s' => \$pass,
......@@ -21,18 +23,18 @@ GetOptions(
'species=s' => \@species,
'source=s' => \@sources,
'download_dir=s' => \$dl_path,
'skipdownload' => \$skipdownload, # skips all downloads
'checkdownload!' => \$checkdownload, # don't download if exists
'skipdownload' => \$skipdownload, # Skips all downloads
'checkdownload!' => \$checkdownload, # Don't download if exists
'create' => \$create,
'setrelease=s' => \$release,
'cleanup' => \$cleanup,
'notsource=s' => \@notsource,
'drop_db|dropdb!' =>
\$drop_existing_db, # drops xref db without user interaction
\$drop_existing_db, # Drop xref db without user interaction
'delete_downloaded' => \$deletedownloaded,
'download_path=s' => \$dl_path,
'compressed' => \$compressed, # don't force decompression of files
'help' => sub { usage(); exit(0); }
'unzip' => \$unzip, # Force decompression of files
'help' => sub { usage(); exit(0); }
);
@species = split(/,/,join(',',@species));
......@@ -53,7 +55,7 @@ XrefParser::BaseParser::run(
$release, $cleanup,
$drop_existing_db, $deletedownloaded,
$dl_path, \@notsource,
$compressed
$unzip
);
# --------------------------------------------------------------------------------
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment