Set permissions of zip contents to 666
Default is: 644, see
https://metacpan.org/pod/IO::Compress::Zip#ExtAttr-=%3E-$attr
Resolves #7
Change-Id: Ic06b365ad9c53af3b05f038bfd49ff1e74038a22
diff --git a/script/conllu2korapxml b/script/conllu2korapxml
index 53cdeca..910ced3 100755
--- a/script/conllu2korapxml
+++ b/script/conllu2korapxml
@@ -203,11 +203,11 @@
my ($fname) = @_;
if (defined $zip) {
$zip->newStream(Zip64 => 1, TextFlag => 1, Method => $_COMPRESSION_METHOD,
- Append => 1, Name => $fname)
+ Append => 1, Name => $fname, ExtAttr => 0100666 << 16)
or die "ERROR ('$fname'): zip failed: $ZipError\n";
} else {
$zip = new IO::Compress::Zip $outh, Zip64 => 1, TextFlag => 1,
- Method => $_COMPRESSION_METHOD, Append => 0, Name => "$fname"
+ Method => $_COMPRESSION_METHOD, Append => 0, Name => "$fname", ExtAttr => 0100666 << 16
or die "ERROR ('$fname'): zip failed: $ZipError\n";
}
}
diff --git a/t/test.t b/t/test.t
index 52ac9d0..53b7006 100644
--- a/t/test.t
+++ b/t/test.t
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 61;
+use Test::More tests => 62;
use Test::Script;
use Test::TempDir::Tiny;
use File::Copy;
@@ -191,9 +191,10 @@
print $fh $zipcontent;
close($fh);
-$zipcontent = `$UNZIP -l $zipfile`;
+$zipcontent = `$UNZIP -Z $zipfile`;
like($zipcontent, qr@GOE/AGA/00000/ud/morpho\.xml@, "conllu2korapxml UDPipe input conversion contains morpho layer with foundry name 'ud'");
like($zipcontent, qr@GOE/AGA/00000/ud/dependency\.xml@, "conllu2korapxml UDPipe input conversion contains dependency layer with foundry name 'ud'");
+like($zipcontent, qr@rw-rw-rw-.*GOE/AGA/00000/ud/morpho\.xml@, "KorAP-XML zip contents have read and write permissions");
script_runs([ 'script/conllu2korapxml', 't/data/deu-deps.conllu' ], "Runs conllu2korap with UDPipe input");
script_stderr_unlike "fileparse(): need a valid pathname", "Ignore sent_id and newdoc id";