Skip to content

Commit 7b51f61

Browse files
charsbarandk
authored andcommitted
Add --warning=no-unknown-keyword to suppress warnings such as "Ignoring unknown extended header keyword"
1 parent e445394 commit 7b51f61

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/PAUSE/dist.pm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,12 @@ sub untar {
177177
local *TARTEST;
178178
my $tarbin = $self->hub->{TARBIN};
179179
my $MLROOT = $self->mlroot;
180-
my $tar_opt = "tzf";
180+
my $tar_opt = "-tzf";
181181
if ($dist =~ /\.(?:tar\.bz2|tbz)$/) {
182-
$tar_opt = "tjf";
182+
$tar_opt = "-tjf";
183183
}
184-
open TARTEST, "$tarbin $tar_opt $MLROOT/$dist |";
184+
my $ignore_unknown_keyword = '--warning=no-unknown-keyword';
185+
open TARTEST, "$tarbin $ignore_unknown_keyword $tar_opt $MLROOT/$dist |";
185186
while (<TARTEST>) {
186187
if (m:^\.\./: || m:/\.\./: ) {
187188
$Logger->log("*** ALERT: updir detected!");
@@ -200,12 +201,12 @@ sub untar {
200201
$self->{COULD_NOT_UNTAR}++;
201202
return;
202203
}
203-
$tar_opt = "xzf";
204+
$tar_opt = "-xzf";
204205
if ($dist =~ /\.(?:tar\.bz2|tbz)$/) {
205-
$tar_opt = "xjf";
206+
$tar_opt = "-xjf";
206207
}
207208

208-
my @cmd = ($tarbin, $tar_opt, "$MLROOT/$dist");
209+
my @cmd = ($tarbin, $ignore_unknown_keyword, $tar_opt, "$MLROOT/$dist");
209210
$Logger->log([ "going to untar with: %s", \@cmd ]);
210211

211212
unless (system(@cmd)==0) {

0 commit comments

Comments
 (0)