[parted] (Re-)apply patch to fix Linux 3.0 problem.

Richard W.M. Jones rjones at fedoraproject.org
Wed Jun 29 13:43:37 UTC 2011


commit 61bbdc442ade7158dbc03a4ee32e3c5a38b023ae
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Jun 29 14:39:02 2011 +0100

    (Re-)apply patch to fix Linux 3.0 problem.

 ...ccommodate-two-component-linux-version-nu.patch |   35 ++++++++++++++++++++
 parted.spec                                        |    7 +++-
 2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/parted-3.0-libparted-accommodate-two-component-linux-version-nu.patch b/parted-3.0-libparted-accommodate-two-component-linux-version-nu.patch
new file mode 100644
index 0000000..43277c9
--- /dev/null
+++ b/parted-3.0-libparted-accommodate-two-component-linux-version-nu.patch
@@ -0,0 +1,35 @@
+From bb4fbe2130cd85727bbaf6c71b2d27b6769aa4aa Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering at redhat.com>
+Date: Sun, 5 Jun 2011 18:15:31 +0200
+Subject: [PATCH] libparted: accommodate two-component linux version number
+ like 3.0
+
+* libparted/arch/linux.c (_get_linux_version): Also accept 2-component
+version numbers.
+* NEWS: (Bug fixes): Mention it.
+Reported by Richard W.M. Jones.
+---
+ NEWS                   |    4 ++++
+ libparted/arch/linux.c |    6 +++++-
+ 2 files changed, 9 insertions(+), 1 deletions(-)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index aeaf98f..111816c 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -610,7 +610,11 @@ _get_linux_version ()
+ 
+         if (uname (&uts))
+                 return kver = 0;
+-        if (sscanf (uts.release, "%u.%u.%u", &major, &minor, &teeny) != 3)
++        if (sscanf (uts.release, "%u.%u.%u", &major, &minor, &teeny) == 3)
++                ; /* ok */
++        else if (sscanf (uts.release, "%u.%u", &major, &minor) == 2)
++                teeny = 0;
++        else
+                 return kver = 0;
+ 
+         return kver = KERNEL_VERSION (major, minor, teeny);
+-- 
+1.7.5.2
+
diff --git a/parted.spec b/parted.spec
index 6b12885..da1b856 100644
--- a/parted.spec
+++ b/parted.spec
@@ -4,7 +4,7 @@
 Summary: The GNU disk partition manipulation program
 Name:    parted
 Version: 3.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv3+
 Group:   Applications/System
 URL:     http://www.gnu.org/software/parted
@@ -22,6 +22,8 @@ Patch2: parted-3.0-libparted-fix-snap-radius-so-that-it-is-using-half.patch
 Patch3: parted-3.0-libparted-don-t-allow-values-less-than-1.patch
 Patch4: parted-3.0-tests-add-test-for-radius-divide-by-2-fix.patch
 Patch5: parted-3.0-tests-add-test-for-value-less-than-1.patch
+# Fix for kernel 3.0 new version numbering.
+Patch6: parted-3.0-libparted-accommodate-two-component-linux-version-nu.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: e2fsprogs-devel
@@ -150,6 +152,9 @@ fi
 
 
 %changelog
+* Wed Jun 29 2011 Richard W.M. Jones <rjones at redhat.com> - 3.0-2
+- (Re-)apply patch to fix Linux "3.0" problem.
+
 * Tue Jun 28 2011 Brian C. Lane <bcl at redhat.com> - 3.0-1
 - Update to parted v3.0
 - Run autoreconf so that patches to .am files will work


More information about the scm-commits mailing list