summaryrefslogtreecommitdiffstats
path: root/perl-install/commands.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-10-29 03:06:22 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-10-29 03:06:22 +0000
commitaa912d0daeaa6d4d84addfd2fc0ebba11e137edd (patch)
tree4c59162be3d838b69b3c709075e83b8bc9d61b7a /perl-install/commands.pm
parenta519379c3ae2eeb70650b6fd9e608bd285d2eba2 (diff)
downloaddrakx-backup-do-not-use-aa912d0daeaa6d4d84addfd2fc0ebba11e137edd.tar
drakx-backup-do-not-use-aa912d0daeaa6d4d84addfd2fc0ebba11e137edd.tar.gz
drakx-backup-do-not-use-aa912d0daeaa6d4d84addfd2fc0ebba11e137edd.tar.bz2
drakx-backup-do-not-use-aa912d0daeaa6d4d84addfd2fc0ebba11e137edd.tar.xz
drakx-backup-do-not-use-aa912d0daeaa6d4d84addfd2fc0ebba11e137edd.zip
no_comment
Diffstat (limited to 'perl-install/commands.pm')
-rw-r--r--perl-install/commands.pm22
1 files changed, 20 insertions, 2 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm
index bb64fc180..c6f68c37a 100644
--- a/perl-install/commands.pm
+++ b/perl-install/commands.pm
@@ -447,7 +447,7 @@ $l{Destination}, $l{Gateway}, $l{Mask}, $l{Iface}
sub df {
my ($h) = getopts(\@_, qw(h));
- my ($dev, $size, $free, $used, $use, $mntpoint);
+ my ($dev, $blocksize, $size, $free, $used, $use, $mntpoint);
open DF, ">&STDOUT";
format DF_TOP =
Filesystem Size Used Avail Use Mounted on
@@ -465,7 +465,9 @@ $dev, $size, $used, $free, $use, $mntpoint
$mntpoint = $h{$dev};
my $buf = ' ' x 20000;
syscall_('statfs', $mntpoint, $buf) or next;
- (undef, undef, $size, $free) = unpack "l7", $buf;
+ (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf;
+ $_ *= $blocksize / 1024 foreach $size, $free;
+
$size or next;
$use = int (100 * ($size - $free) / $size);
@@ -490,6 +492,22 @@ sub lspci {
require 'pci_probing/main.pm';
print join "\n", pci_probing::main::list (), '';
}
+sub dmesg { print cat_("/tmp/syslog"); }
+
+sub install_cpio($$) {
+ my ($dir, $name) = @_;
+
+ return "$dir/$name" if -e "$dir/$name";
+
+ my $cpio = "$dir.cpio.bz2";
+ -e $cpio or return;
+
+ eval { rm("-r", $dir) };
+ mkdir $dir, 0755;
+ require 'run_program.pm';
+ run_program::run("cd $dir ; bzip2 -cd $cpio | cpio -id $name $name/*");
+ "$dir/$name";
+}
#-######################################################################################
#- Wonderful perl :(