From 730cb53b7ffa06f425d9631f72f9b6a287e0995e Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Tue, 12 Feb 2013 12:32:40 +0000 Subject: [PATCH 1/5] Perl's make_path should be mkpath in SLE 11, see BNC #801714 --- src/scripts/backup_archive.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/backup_archive.pl b/src/scripts/backup_archive.pl index c716590..e974e59 100755 --- a/src/scripts/backup_archive.pl +++ b/src/scripts/backup_archive.pl @@ -22,7 +22,7 @@ use File::Temp qw( tempdir ); use POSIX qw( strftime ); -use File::Path qw(make_path); +use File::Path qw(mkpath); # command line options my $archive_name = ''; @@ -76,9 +76,9 @@ ($) { my $dirs = substr($f, 0, $ix); if ($verbose) { - print "Running: make_path $dirs\n"; + print "Running: mkpath $dirs\n"; } - make_path($dirs); + mkpath($dirs); } } From c0241672935435f762ceb8364026fed341eab8a0 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Wed, 13 Feb 2013 14:00:16 +0000 Subject: [PATCH 2/5] Logging more debugging info - Previous logging was extended by adding Perl error messages - Logging stderr output from backup script --- src/scripts/backup_archive.pl | 28 +++++++++++++++++++--------- src/ui.ycp | 13 +++++++++++-- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/scripts/backup_archive.pl b/src/scripts/backup_archive.pl index e974e59..226ce6b 100755 --- a/src/scripts/backup_archive.pl +++ b/src/scripts/backup_archive.pl @@ -188,7 +188,7 @@ ($) create_dirs($archive_name); open(OUT, '>', $archive_name) - or die "Error storing file list\n"; + or die "Error storing file list to ".$archive_name.": ".$!."\n"; if (defined open(FILES, $files_info)) { @@ -215,37 +215,37 @@ ($) # create parent temporary directory system("/bin/mkdir -p '$temp_dir'"); if (! -d $temp_dir) { - die "Cannot create directory $temp_dir: ".$!; + die "Cannot create directory ".$temp_dir.": ".$!; } my $tmp_dir_root = tempdir($temp_dir."/backup_tmp_XXXXXXXX", CLEANUP => 1); # remove directory content at exit system("/bin/mkdir -p '$tmp_dir_root'"); if (! -d $tmp_dir_root) { - die "Cannot create directory $tmp_dir_root: ".$!; + die "Cannot create directory ".$tmp_dir_root.": ".$!; } my $tmp_dir = $tmp_dir_root."/tmp"; if (!mkdir($tmp_dir)) { - die "Can not create directory $tmp_dir\n"; + die "Can not create directory ".$tmp_dir.": ".$!."\n"; } $tmp_dir .= "/info"; if (!mkdir($tmp_dir)) { - die "Can not create directory $tmp_dir\n"; + die "Can not create directory ".$tmp_dir.": ".$!."\n"; } my $tmp_dir_sys = $tmp_dir_root."/tmp/system"; if (!mkdir($tmp_dir_sys)) { - die "Can not create directory $tmp_dir_sys\n"; + die "Can not create directory ".$tmp_dir_sys.": ".$!."\n"; } my $files_num = 0; open(OUT, '>', $tmp_dir."/files") - or die "Can not open file $tmp_dir/files\n"; + or die "Can not open file ".$tmp_dir."/files: ".$!."\n"; print OUT "info/files\n"; @@ -471,8 +471,8 @@ ($) # filter files_info file, output only file names -open(FILES_INFO, "> $tmp_dir/packages_info") - or die "Can not create file $tmp_dir/packages_info\n"; +open(FILES_INFO, '>', $tmp_dir."/packages_info") + or die "Can not create file ".$tmp_dir."/packages_info: ".$!."\n"; my $package_name; my $install_prefix; @@ -814,7 +814,17 @@ ($) print STDERR $!."\n"; +# Flush the error output +select(STDERR); +$| = 1; + +# Flush the standard output +select(STDOUT); +$| = 1; + if ($verbose) { print "/Tar result: $?\n"; } + +exit 0; diff --git a/src/ui.ycp b/src/ui.ycp index dfa1b66..630b0ec 100644 --- a/src/ui.ycp +++ b/src/ui.ycp @@ -2855,8 +2855,16 @@ Aborting the backup. } // end while - y2milestone ("DEBUG: running %1", (boolean) SCR::Read (.process.running, backup_PID)); - y2milestone ("DEBUG: empty %1", (boolean) SCR::Read (.process.buffer_empty, backup_PID)); + y2milestone ("DEBUG: process running: %1", (boolean) SCR::Read (.process.running, backup_PID)); + y2milestone ("DEBUG: buffer empty: %1", (boolean) SCR::Read (.process.buffer_empty, backup_PID)); + + // Store process error output + any read_stderr = SCR::Read (.process.read_stderr, backup_PID); + if (read_stderr != nil && read_stderr != "") { + y2error ("DEBUG: stderr: %1", read_stderr); + } else { + y2milestone ("DEBUG: stderr: %1", read_stderr); + } Backup::selected_files = $[]; @@ -3128,6 +3136,7 @@ Replace the existing profile? // part of summary text - %1 is file name string profilesummary = (((boolean)(profilewritten["result"]:false)) == true) ? sformat(_("Autoinstallation profile saved to file %1."), (string)(profilewritten["profile"]:"")) : (em + _("Autoinstallation profile was not saved.") + _em); + y2milestone ("Tar result: '%1'", tar_result); backup_result = backup_result // part of summary text + ((tar_result == 0) ? archive_created : (em + _("Archive creation failed") + _em)) From 1a9bb28f27ef31e4ca9bb87817f4023b19bf7854 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Tue, 19 Feb 2013 15:12:55 +0000 Subject: [PATCH 3/5] Changes file and a new version --- package/yast2-backup.changes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/yast2-backup.changes b/package/yast2-backup.changes index bd75597..9ce3e51 100644 --- a/package/yast2-backup.changes +++ b/package/yast2-backup.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Feb 19 15:11:46 UTC 2013 - locilka@suse.com + +- Perl's make_path should be mkpath in SLE 11 + see (bnc#801714, bnc#803291) +- 2.17.14 + ------------------------------------------------------------------- Fri Nov 2 11:27:29 UTC 2012 - locilka@suse.com From 9c84809cd3f37a2a8e3489cdbdbb6429040ddb1c Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Tue, 19 Feb 2013 15:19:49 +0000 Subject: [PATCH 4/5] No new version yet --- package/yast2-backup.changes | 1 - 1 file changed, 1 deletion(-) diff --git a/package/yast2-backup.changes b/package/yast2-backup.changes index 9ce3e51..d15742b 100644 --- a/package/yast2-backup.changes +++ b/package/yast2-backup.changes @@ -3,7 +3,6 @@ Tue Feb 19 15:11:46 UTC 2013 - locilka@suse.com - Perl's make_path should be mkpath in SLE 11 see (bnc#801714, bnc#803291) -- 2.17.14 ------------------------------------------------------------------- Fri Nov 2 11:27:29 UTC 2012 - locilka@suse.com From fe777a80f4c72a1ec57093e1ffa6e4d03e1a1c7a Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Wed, 20 Feb 2013 08:53:27 +0000 Subject: [PATCH 5/5] Less logging if not needed - and removing "DEBUG: " that looks really bad --- src/ui.ycp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ui.ycp b/src/ui.ycp index 630b0ec..b166b2d 100644 --- a/src/ui.ycp +++ b/src/ui.ycp @@ -2855,15 +2855,15 @@ Aborting the backup. } // end while - y2milestone ("DEBUG: process running: %1", (boolean) SCR::Read (.process.running, backup_PID)); - y2milestone ("DEBUG: buffer empty: %1", (boolean) SCR::Read (.process.buffer_empty, backup_PID)); + y2milestone ("archiving process running: %1, buffer empty: %2", + (boolean) SCR::Read (.process.running, backup_PID), + (boolean) SCR::Read (.process.buffer_empty, backup_PID) + ); - // Store process error output + // Store process error output if any any read_stderr = SCR::Read (.process.read_stderr, backup_PID); if (read_stderr != nil && read_stderr != "") { - y2error ("DEBUG: stderr: %1", read_stderr); - } else { - y2milestone ("DEBUG: stderr: %1", read_stderr); + y2error ("archiving process stderr: %1", read_stderr); } Backup::selected_files = $[];