[yast-commit] r67194 - in /branches/SuSE-Linux-12_1-Branch/backup: VERSION package/yast2-backup.changes src/scripts/backup_search.pl
Author: locilka Date: Fri Jan 13 15:55:24 2012 New Revision: 67194 URL: http://svn.opensuse.org/viewcvs/yast?rev=67194&view=rev Log: - Fixed parsing output from verification of packages (bnc #736233) - 2.21.4 Modified: branches/SuSE-Linux-12_1-Branch/backup/VERSION branches/SuSE-Linux-12_1-Branch/backup/package/yast2-backup.changes branches/SuSE-Linux-12_1-Branch/backup/src/scripts/backup_search.pl Modified: branches/SuSE-Linux-12_1-Branch/backup/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-12_1-Branch/backup/VERSION?rev=67194&r1=67193&r2=67194&view=diff ============================================================================== --- branches/SuSE-Linux-12_1-Branch/backup/VERSION (original) +++ branches/SuSE-Linux-12_1-Branch/backup/VERSION Fri Jan 13 15:55:24 2012 @@ -1 +1 @@ -2.21.3 +2.21.4 Modified: branches/SuSE-Linux-12_1-Branch/backup/package/yast2-backup.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-12_1-Branch/backup/package/yast2-backup.changes?rev=67194&r1=67193&r2=67194&view=diff ============================================================================== --- branches/SuSE-Linux-12_1-Branch/backup/package/yast2-backup.changes (original) +++ branches/SuSE-Linux-12_1-Branch/backup/package/yast2-backup.changes Fri Jan 13 15:55:24 2012 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Jan 13 15:53:45 CET 2012 - locilka@suse.cz + +- Fixed parsing output from verification of packages (bnc #736233) +- 2.21.4 + +------------------------------------------------------------------- Fri Oct 14 12:22:11 CEST 2011 - locilka@suse.cz - Using UI::AskForSaveFileName for selecting new/existent file Modified: branches/SuSE-Linux-12_1-Branch/backup/src/scripts/backup_search.pl URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-12_1-Branch/backup/src/scripts/backup_search.pl?rev=67194&r1=67193&r2=67194&view=diff ============================================================================== --- branches/SuSE-Linux-12_1-Branch/backup/src/scripts/backup_search.pl (original) +++ branches/SuSE-Linux-12_1-Branch/backup/src/scripts/backup_search.pl Fri Jan 13 15:55:24 2012 @@ -25,9 +25,9 @@ #function prototypes sub ReadAllPackages(); sub FsToDirs(@); -sub ReadAllFiles(%%); -sub VerifyPackages(@%%); -sub SearchDirectory($%%%); +sub ReadAllFiles; +sub VerifyPackages; +sub SearchDirectory; # command line options my $search_files = 0; @@ -453,6 +453,21 @@ } } +sub split_rpm_verify ($) { + # format of the line: + # _9_chars_with_changed_attrs_ _1_char_file_type_ /changed/file/name + # + # example: + # 5S.T..... c /etc/ssh/sshd_config + my $verify_output_line = shift; + + my $rpmout = substr($verify_output_line, 0, 9); + my $filename = $verify_output_line; + $filename =~ s/^.{9}[^\/]+//; + + return ($rpmout, $filename); +} + # Check file and return whether to backup or not sub CheckFile { my $line = shift; @@ -470,25 +485,26 @@ my $backup = 1; my $file_size = 0; - $link = ($$line =~ /^....L.* (\/.*)/); + my ($verify_out, $filename) = split_rpm_verify ($$line); + $link = ($verify_out =~ /L/); if ($link) { - $file = $1; + $file = $filename; } if ($no_md5) { - $size = ($$line =~ /^S.* (\/.*)/); + $size = ($verify_out =~ /S/); if ($size) { - $file = $1; + $file = $filename; } - $mtime = ($$line =~ /^\..{6}T.* (\/.*)/); + $mtime = ($verify_out =~ /T/); if ($mtime) { - $file = $1; + $file = $filename; } @@ -529,7 +545,8 @@ { while (my $fl = <RPMVRF>) { - if (($fl !~ /^S.* \/./) and ($fl !~ /^\..{6}T.* \/.*/) and ($fl !~ /^..5.* \/.*/)) + my ($vo, $fn) = split_rpm_verify ($fl); + if (($vo !~ /S/) and ($vo !~ /T/) and ($vo !~ /5/)) { $backup = 0; } @@ -545,10 +562,11 @@ } else { - $md5_test = ($$line =~ /^..5.* (\/.*)/); + my ($rpmout, $filename) = split_rpm_verify($$line); + $md5_test = ($rpmout =~ /5/); if ($md5_test) { - $file = $1; + $file = $filename; } } @@ -563,7 +581,7 @@ } # verify each package in the list -sub VerifyPackages(@%%) { +sub VerifyPackages() { my ($packages, $unavail, $duplicates) = @_; # rpm -q --filesbypkg @all-rpm-packages @@ -635,7 +653,7 @@ # read all files which belong to packages -sub ReadAllFiles(%%) +sub ReadAllFiles() { my ($all_files, $pkg_inodes) = @_; my %duplicates; @@ -731,7 +749,7 @@ } # search files which do not belong to any package -sub SearchDirectory($%%%) +sub SearchDirectory() { my ($dir, $files, $exclude, $inodes) = @_; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn2.opensuse.org