Skip to content

Commit

Permalink
r2938@k75: k | 2007-08-05 02:10:39 +0200
Browse files Browse the repository at this point in the history
 new option tar_verbosity


git-svn-id: https://pause.perl.org:5460/svn/cpanpm/trunk@2096 81f69c26-07c4-0310-b1c3-f486c8728884
  • Loading branch information
andk committed Aug 5, 2007
1 parent b728f8d commit 6024d43
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
5 changes: 4 additions & 1 deletion lib/CPAN.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3101,7 +3101,9 @@ sub rematein {
# enter the queue but not its copy. How do they get a sensible
# test_count?

my $needs_recursion_protection = "make|test|install";
# With configure_requires, "get" is vulnerable in recursion.

my $needs_recursion_protection = "get|make|test|install";

# construct the queue
my($s,@s,@qcopy);
Expand Down Expand Up @@ -10637,6 +10639,7 @@ defined:
show_upload_date boolean if commands should try to determine upload date
show_zero_versions boolean if r command tells for which modules $version==0
tar location of external program tar
tar_verbosity verbosity level for the tar command
term_is_latin if true internal UTF-8 is translated to ISO-8859-1
(and nonsense for characters outside latin range)
term_ornaments boolean to turn ReadLine ornamenting on/off
Expand Down
17 changes: 17 additions & 0 deletions lib/CPAN/FirstTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ substitute. You can then revisit this dialog with
}
}

if (!$matcher or 'tar_verbosity' =~ /$matcher/) {
$CPAN::Frontend->myprint($prompts{tar_verbosity_intro});
my_prompt_loop(tar_verbosity => 'v', $matcher,
'none|v|vv');
}

#
#= Installer, arguments to make etc.
#
Expand Down Expand Up @@ -1285,6 +1291,17 @@ Build.PL.
},

tar_verbosity_intro => qq{
When CPAN.pm uses the tar command, which switch for the verbosity
shall be used? Choose 'none' for quiet operation, 'v' for file
name listing, 'vv' for full listing.
},

tar_verbosity =>
qq{Tar command verbosity level (none or v or vv)?},

prefer_installer =>
qq{In case you could choose, which installer would you prefer (EUMM or MB)?},

Expand Down
1 change: 1 addition & 0 deletions lib/CPAN/HandleConfig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ $VERSION = sprintf "%.6f", substr(q$Rev$,4)/1000000 + 5.4;
"show_upload_date",
"show_zero_versions",
"tar",
"tar_verbosity",
"term_is_latin",
"term_ornaments",
"test_report",
Expand Down
15 changes: 11 additions & 4 deletions lib/CPAN/Tarzip.pm
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,21 @@ CPAN.pm needs either the external programs tar, gzip and bzip2
installed. Can't continue.
});
}
my $tar_verb = "v";
if (defined $CPAN::Config->{tar_verbosity}) {
$tar_verb = $CPAN::Config->{tar_verbosity} eq "none" ? "" :
$CPAN::Config->{tar_verbosity};
}
if ($prefer==1) { # 1 => external gzip+tar
my($system);
my $is_compressed = $self->gtest();
my $tarcommand = CPAN::HandleConfig->safe_quote($CPAN::Config->{tar}) || "tar";
if ($is_compressed) {
my $command = CPAN::HandleConfig->safe_quote($self->{UNGZIPPRG});
$system = qq{$command -dc }.
qq{< "$file" | $tarcommand xvf -};
qq{< "$file" | $tarcommand x${tar_verb}f -};
} else {
$system = qq{$tarcommand xvf "$file"};
$system = qq{$tarcommand x${tar_verb}f "$file"};
}
if (system($system) != 0) {
# people find the most curious tar binaries that cannot handle
Expand All @@ -245,7 +250,7 @@ installed. Can't continue.
}
$file = $ungzf;
}
$system = qq{$tarcommand xvf "$file"};
$system = qq{$tarcommand x${tar_verb}f "$file"};
$CPAN::Frontend->myprint(qq{Using Tar:$system:\n});
if (system($system)==0) {
$CPAN::Frontend->myprint(qq{Untarred $file successfully\n});
Expand Down Expand Up @@ -285,7 +290,9 @@ installed. Can't continue.
$CPAN::Frontend->mydie("ALERT: Archive contains ".
"illegal member [$af]");
}
$CPAN::Frontend->myprint("$af\n");
if ($tar_verb eq "v" || $tar_verb eq "vv") {
$CPAN::Frontend->myprint("$af\n");
}
push @af, $af;
return if $CPAN::Signal;
}
Expand Down
4 changes: 2 additions & 2 deletions t/10version.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use CPAN::Version;
use vars qw($D $N);

# for debugging uncomment the next two lines
use CPAN;
$CPAN::DEBUG = 16384;
# use CPAN;
# $CPAN::DEBUG = 16384;

while (<DATA>) {
next if tr/.// > 1 && $]<5.006; # multidot tests are not for pre-5.6.0
Expand Down

0 comments on commit 6024d43

Please sign in to comment.