Treat prefixes correct for text sigles
Change-Id: I710912f4681f16d866410ead0e050afe55c61b68
diff --git a/script/korapxml2krill b/script/korapxml2krill
index 43ac47a..6bdb961 100644
--- a/script/korapxml2krill
+++ b/script/korapxml2krill
@@ -391,13 +391,18 @@
# Sigle is a doc sigle
if ($_ =~ m!^(?:\.[/\\])?[^/\\]+?[/\\][^/\\]+?$!) {
- print "$_ ...\n";
+ print "$_ ...";
# Check if a prefix is needed
unless ($prefix_check) {
- $prefix = $archive->check_prefix;
+
+ if ($prefix = $archive->check_prefix) {
+ print " with prefix ...";
+ };
$prefix_check = 1;
};
+ print "\n";
+
# TODO: Make this OS independent
my $path = ($prefix ? './' : '') . $_;
@@ -408,8 +413,18 @@
);
print "extracted.\n";
}
+
+ # Sigle is a text sigle
else {
push @new_sigle, $_;
+
+ unless ($prefix_check) {
+
+ if ($prefix = $archive->check_prefix) {
+ print " with prefix ...";
+ };
+ $prefix_check = 1;
+ };
};
};
@sigle = @new_sigle;
@@ -417,10 +432,12 @@
# Iterate over all given sigles and extract
foreach (@sigle) {
+
print "$_ ...\n";
# TODO: Make this OS independent
print '... ' . (
+
$archive->extract_text(
($prefix ? './' : '') . $_, $output
) ? '' : 'not '