summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-11-01 10:14:16 +0100
committerDavid Tardon <dtardon@redhat.com>2014-11-01 10:14:41 +0100
commit76d2d78ac48c0ec7fcdc27c841d0777cab732464 (patch)
tree97f61b0829595fa3f0356be76975ff2006464ea4
parent7f5672bb14956d589fd257067b9eebef3c28e421 (diff)
fdo#85633 filter out empty file records
Change-Id: I9f96cf3e059d444c52ce81b37cf5f69157c2888d
-rw-r--r--solenv/bin/modules/par2script/work.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/solenv/bin/modules/par2script/work.pm b/solenv/bin/modules/par2script/work.pm
index 9c03078cdf17..80037850bcc4 100644
--- a/solenv/bin/modules/par2script/work.pm
+++ b/solenv/bin/modules/par2script/work.pm
@@ -187,6 +187,11 @@ sub collect_definitions
if ( $oneitem eq "Directory" ) { if ( $itemkey =~ "DosName" ) { $itemkey =~ s/DosName/HostName/; } }
if (( $oneitem eq "Directory" ) || ( $oneitem eq "File" ) || ( $oneitem eq "Unixlink" )) { if ( $itemvalue eq "PD_PROGDIR" ) { $itemvalue = "PREDEFINED_PROGDIR"; }}
if (( $itemkey eq "Styles" ) && ( $itemvalue =~ /^\s*(\w+)(\s*\;\s*)$/ )) { $itemvalue = "($1)$2"; }
+ elsif ( $itemkey eq "Files" ) # filter out empty file records, as they mess up assignment to modules
+ {
+ $itemvalue =~ /^\(([^)]*)\)$/;
+ $itemvalue = '(' . join( ',', grep( !/^$/, split( ',', $1 ) ) ) . ')';
+ }
$oneitemhash{$itemkey} = $itemvalue;
}