summaryrefslogtreecommitdiffstats
path: root/perl-install/commands.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-08-28 10:19:54 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-08-28 10:19:54 +0000
commit2d3b13d3b7e6f08f6310467ece7d399c5858d233 (patch)
tree61e0a5cc6284c4e8dc138385da6329f2b8e83e0f /perl-install/commands.pm
parent90f7bb2359c71498b66bf6eb4ed764671816ace6 (diff)
downloaddrakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.gz
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.bz2
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.tar.xz
drakx-2d3b13d3b7e6f08f6310467ece7d399c5858d233.zip
no_comment
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r--perl-install/commands.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index 44a49a17f..1e09d7329 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -274,8 +274,9 @@ $pid, $cpu, $cmd
sub dd {
- my $u = "usage: dd [-h] [if=<file>] [of=<file>] [bs=<number>] [count=<number>]\n";
- (getopts(\@_, qw(h)))[0] and die $u;
+ my $u = "usage: dd [-h] [-p] [if=<file>] [of=<file>] [bs=<number>] [count=<number>]\n";
+ my ($help, $percent) = getopts(\@_, qw(hp));
+ die $u if $help;
my %h = (if => \*STDIN, of => \*STDOUT, bs => 512, count => undef);
foreach (@_) {
/(.*?)=(.*)/ && exists $h{$1} or die $u;
@@ -290,12 +291,13 @@ sub dd {
$h{bs} =~ /(\d+)G$/ and $h{bs} = $1 * 1024 * 1024 * 1024;
for ($nb = 0; !$h{count} || $nb < $h{count}; $nb++) {
+ printf "\r%02.1d%%", 100 * $nb / $h{count} if $h{count} && $percent;
$read = sysread(IF, $tmp, $h{bs}) or $h{count} ? die "error: can't read block $nb\n" : last;
syswrite(OF, $tmp) or die "error: can't write block $nb\n";
$read < $h{bs} and $read = 1, last;
}
- print STDERR "$nb+$read records in\n";
- print STDERR "$nb+$read records out\n";
+ print STDERR "\r$nb+$read records in\n";
+ print STDERR "$nb+$read records out\n";
}
sub head_tail {