[ooo-build-commit] patches/apply.pl.in

Petr Mladek pmladek at kemper.freedesktop.org
Mon Nov 23 04:21:35 PST 2009


 patches/apply.pl.in |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit a18e1b9821f904fd5e70aca8b2a69c31402a8dba
Author: Petr Mladek <pmladek at suse.cz>
Date:   Mon Nov 23 13:19:55 2009 +0100

    Fix check for old GNU patch tool (i#107027)
    
    * patches/apply.pl.in: do not break with GNU patch-2.6

diff --git a/patches/apply.pl.in b/patches/apply.pl.in
index 8a515f3..5b8c8e4 100755
--- a/patches/apply.pl.in
+++ b/patches/apply.pl.in
@@ -921,11 +921,13 @@ sub is_old_patch_version()
 
     open ($Patch, "@GNUPATCH@ --version|") || die "Can't run patch: $!";
     $ver_line = <$Patch>;
-    $ver_line =~ m/\s+(\d+)\.(\d+)\.(\d+)/ || die "Can't get patch version\n";
-    if ($1 >= 2 && $2 >= 5 && $3 >= 9) {
+    $ver_line =~ m/\s+(\d+)\.(\d+)\.?(\d+)?/ || die "Can't get patch version\n";
+    if ( ( $1 > 2 ) ||
+         ( $1 == 2 && $2 > 5 ) ||
+         ( $1 == 2 && $2 == 5 && $3 >= 9 ) ) {
 	$is_old = 0;
     }
-    
+
     if ($is_old) {
 	print "Old patch version - pruning LFs\n";
     }


More information about the ooo-build-commit mailing list