Mailinglist Archive: yast-commit (265 mails)

< Previous Next >
[yast-commit] r67195 - in /trunk/backup: VERSION package/yast2-backup.changes src/scripts/backup_search.pl
Author: locilka
Date: Fri Jan 13 15:55:44 2012
New Revision: 67195

URL: http://svn.opensuse.org/viewcvs/yast?rev=67195&view=rev
Log:
- Fixed parsing output from verification of packages (bnc #736233)
- 2.22.0


Modified:
trunk/backup/VERSION
trunk/backup/package/yast2-backup.changes
trunk/backup/src/scripts/backup_search.pl

Modified: trunk/backup/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/backup/VERSION?rev=67195&r1=67194&r2=67195&view=diff
==============================================================================
--- trunk/backup/VERSION (original)
+++ trunk/backup/VERSION Fri Jan 13 15:55:44 2012
@@ -1 +1 @@
-2.21.3
+2.22.0

Modified: trunk/backup/package/yast2-backup.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/backup/package/yast2-backup.changes?rev=67195&r1=67194&r2=67195&view=diff
==============================================================================
--- trunk/backup/package/yast2-backup.changes (original)
+++ trunk/backup/package/yast2-backup.changes Fri Jan 13 15:55:44 2012
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Jan 13 15:53:45 CET 2012 - locilka@xxxxxxx
+
+- Fixed parsing output from verification of packages (bnc #736233)
+- 2.22.0
+
+-------------------------------------------------------------------
Fri Oct 14 12:22:11 CEST 2011 - locilka@xxxxxxx

- Using UI::AskForSaveFileName for selecting new/existent file

Modified: trunk/backup/src/scripts/backup_search.pl
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/backup/src/scripts/backup_search.pl?rev=67195&r1=67194&r2=67195&view=diff
==============================================================================
--- trunk/backup/src/scripts/backup_search.pl (original)
+++ trunk/backup/src/scripts/backup_search.pl Fri Jan 13 15:55:44 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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages