Skip to content

Commit

Permalink
Merge pull request #9 from kobliha/Code-11-SP1
Browse files Browse the repository at this point in the history
The same fix as for SP2 goes also to SP1
  • Loading branch information
kobliha committed Feb 20, 2013
2 parents 7649934 + fe777a8 commit aad21c2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
6 changes: 6 additions & 0 deletions package/yast2-backup.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
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)

-------------------------------------------------------------------
Fri Nov 2 11:27:29 UTC 2012 - locilka@suse.com

Expand Down
34 changes: 22 additions & 12 deletions src/scripts/backup_archive.pl
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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))
{
Expand All @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
13 changes: 11 additions & 2 deletions src/ui.ycp
Expand Up @@ -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 ("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 if any
any read_stderr = SCR::Read (.process.read_stderr, backup_PID);
if (read_stderr != nil && read_stderr != "") {
y2error ("archiving process stderr: %1", read_stderr);
}

Backup::selected_files = $[];

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit aad21c2

Please sign in to comment.