diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-28 08:21:15 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-05-28 08:21:15 +0000 |
commit | 7db099c14da7fde27be0cd6dbe0bf79183420a4f (patch) | |
tree | 646b1d606c8f0c60d18d54b43861e099a93c21cd /perl-install/standalone/drakbackup | |
parent | bb5d5f6f9a104490f1d4497a091d3ed9adac0ca2 (diff) | |
download | drakx-7db099c14da7fde27be0cd6dbe0bf79183420a4f.tar drakx-7db099c14da7fde27be0cd6dbe0bf79183420a4f.tar.gz drakx-7db099c14da7fde27be0cd6dbe0bf79183420a4f.tar.bz2 drakx-7db099c14da7fde27be0cd6dbe0bf79183420a4f.tar.xz drakx-7db099c14da7fde27be0cd6dbe0bf79183420a4f.zip |
merge fixes from HEAD
Diffstat (limited to 'perl-install/standalone/drakbackup')
-rwxr-xr-x | perl-install/standalone/drakbackup | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup index 351f363f3..00f3a3a15 100755 --- a/perl-install/standalone/drakbackup +++ b/perl-install/standalone/drakbackup @@ -225,14 +225,11 @@ sub get_tape_info() { @tape_devices = (); system("dmesg | grep 'st[0-9] at' > $info"); - local *INFO; - open INFO, $info or warn("Can't open $info\n"); - local $_; - while (<INFO>) { + my @info = cat_($info); + foreach (@info) { @line_data = split(/[ \t,]+/, $_); push @tape_devices, "/dev/" . $line_data[3]; } - close INFO; unlink($info); } @@ -1044,7 +1041,7 @@ sub build_backup_files() { do_find(undef, $find_args_user, $list_file, $path_name); do_tar($tar_cmd_user, "backup_$incr$user", undef, $path_name); } - push_list("$incr$user") if $incr =~ /_user/; + push_list("list_$incr$user") if $incr =~ /_user/; files_to_results("$incr$user"); } } @@ -1254,7 +1251,7 @@ sub push_list { my $filename = $conf{PATH_TO_SAVE} . "/" . $prefix . $the_time . "."; $filename .= $conf{OPTION_COMP} if $prefix =~ /^backup/; $filename .= "txt" if $prefix =~ /^list/; - push @file_list_to_send_by_ftp, $filename; + push @file_list_to_send_by_ftp, $filename if -e $filename; } sub files_to_results { @@ -2776,22 +2773,18 @@ sub restore_aff_result() { button_box_ok_only(); $central_widget = \$do_restore; $up_box->show_all; - } sub return_path { my ($username) = @_; my $usr; my $home_dir; - my $passwdfile = "/etc/passwd"; - local *PASSWD; - open(PASSWD, $passwdfile) or exit 1; - while (defined(my $line = <PASSWD>)) { + my @passwords = cat_("/etc/passwd"); + foreach my $line (@passwords) { chomp($line); ($usr, $home_dir) = (split(/:/, $line))[0,5]; last if $usr eq $username; } - close(PASSWD); return $home_dir; } |