summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-13 05:13:47 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-13 05:13:47 +0000
commita760b07d7a5f0252ed61f68beb7176565166a195 (patch)
treebb5cb0fab1b062aa3acb1fc1d87f6917712c6b7e /perl-install/standalone
parent94b0f241d792c105c85eb51b4af04cbf703f3408 (diff)
downloaddrakx-backup-do-not-use-a760b07d7a5f0252ed61f68beb7176565166a195.tar
drakx-backup-do-not-use-a760b07d7a5f0252ed61f68beb7176565166a195.tar.gz
drakx-backup-do-not-use-a760b07d7a5f0252ed61f68beb7176565166a195.tar.bz2
drakx-backup-do-not-use-a760b07d7a5f0252ed61f68beb7176565166a195.tar.xz
drakx-backup-do-not-use-a760b07d7a5f0252ed61f68beb7176565166a195.zip
drakupdate_fstab: add debug mode that dumps argv, device list and fstab
to make bug reports easier
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakupdate_fstab10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl-install/standalone/drakupdate_fstab b/perl-install/standalone/drakupdate_fstab
index 31775ca43..019d3cce7 100755
--- a/perl-install/standalone/drakupdate_fstab
+++ b/perl-install/standalone/drakupdate_fstab
@@ -34,6 +34,7 @@ log::l("drakupdate_fstab called with @ARGV\n");
$::testing = $ARGV[0] eq '--test' && shift @ARGV;
$::auto = $ARGV[0] eq '--auto' && shift @ARGV;
my $no_flag = $ARGV[0] eq '--no-flag' && shift @ARGV;
+my $debug = $ARGV[0] eq '--debug' && shift @ARGV;
my ($raw_action, $device_name) = @ARGV;
my ($action) = $raw_action =~ /^--(add|del)/;
@@ -60,6 +61,10 @@ sub device_name_to_entry {
$name =~ s|/dev/||;
$name =~ /fd[01]/ && !$::auto and return { device => $name };
my @l = detect_devices::get();
+ if ($debug) {
+ require Data::Dumper;
+ output("/tmp/drakdump_devices-$action", Data::Dumper->Dump([ \@l ], [ qw($l) ]));
+ }
my $e;
if (my ($devfs_prefix, $nb) = $name =~ m,(.*)/(?:cd|disc|part(\d+))$,) {
@@ -130,6 +135,11 @@ sub main {
my $fstab = [ fs::read_fstab('', '/etc/fstab', 'keep_freq_passno', 'keep_devfs_name', 'verbatim_credentials') ];
my ($existing_fstab_entries, $fstab_) = partition { fsedit::is_same_hd($_, $part) } @$fstab;
+ if ($debug) {
+ require Data::Dumper;
+ output("/tmp/drakdump_entries-$action", Data::Dumper->Dump([ \@ARGV, $part, $fstab, $fstab_, $existing_fstab_entries ],
+ [ qw($ARGV $part $fstab $fstab_ $existing_fstab_entries) ]));
+ }
if ($action eq 'add') {
if (@$existing_fstab_entries) {
print STDERR "Already in fstab\n" if $::testing;