[arch-commits] Commit in mdadm/trunk (PKGBUILD linux-3.0.patch)

Tobias Powalowski tpowa at archlinux.org
Wed Aug 3 06:56:41 UTC 2011


    Date: Wednesday, August 3, 2011 @ 02:56:40
  Author: tpowa
Revision: 134363

upgpkg: mdadm 3.2.2-3
add linux-3.0 compat patch

Added:
  mdadm/trunk/linux-3.0.patch
Modified:
  mdadm/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   11 +++++++----
 linux-3.0.patch |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-08-03 06:03:20 UTC (rev 134362)
+++ PKGBUILD	2011-08-03 06:56:40 UTC (rev 134363)
@@ -3,7 +3,7 @@
 # Contributor: Judd Vinet <jvinet at zeroflux.org>
 pkgname=mdadm
 pkgver=3.2.2
-pkgrel=2
+pkgrel=3
 pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID"
 arch=(i686 x86_64)
 license=('GPL')
@@ -17,7 +17,8 @@
         mdadm.conf 
         mdadm_install
         mdadm_hook
-        disable-werror.patch)
+        disable-werror.patch
+        linux-3.0.patch)
 install=mdadm.install
 replaces=('raidtools')
 md5sums=('12ee2fbf3beddb60601fb7a4c4905651'
@@ -25,12 +26,14 @@
          '00cbed931db4f15b6ce49e3e7d433966'
          '4bb000166fb13e82ceaa2422fdfaac7e'
          '36f7cc564ed3267888d90208e0eb7adc'
-         '4ad87b74a4bc9a34621280abe0e0c3e4')
+         '4ad87b74a4bc9a34621280abe0e0c3e4'
+         'c499b3edbf2c400c8a1984e18c7ce7fa')
 
 build() {
   cd $srcdir/$pkgname-$pkgver
   patch -Np0 -i ../disable-werror.patch
-  make CXFLAGS="$CFLAGS"
+  patch -Np1 -i ../linux-3.0.patch
+  make CXiFLAGS="$CFLAGS"
 }
 
 package() {

Added: linux-3.0.patch
===================================================================
--- linux-3.0.patch	                        (rev 0)
+++ linux-3.0.patch	2011-08-03 06:56:40 UTC (rev 134363)
@@ -0,0 +1,45 @@
+From f161d047eed634b3380262767f955eb888502e88 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb at suse.de>
+Date: Fri, 17 Jun 2011 22:49:24 +1000
+Subject: [PATCH 1/1] util: correctly parse shorter linux version numbers.
+
+The next version of Linux might be 3.0.  If it is, get_linux_version
+will fail.
+So make it more robust.
+
+Reported-by: Namhyung Kim <namhyung at gmail.com>
+Reported-by: Milan Broz <mbroz at redhat.com>
+Signed-off-by: NeilBrown <neilb at suse.de>
+---
+ util.c |   10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/util.c b/util.c
+index 10bbe56..55d171a 100644
+--- a/util.c
++++ b/util.c
+@@ -146,16 +146,16 @@ int get_linux_version()
+ {
+ 	struct utsname name;
+ 	char *cp;
+-	int a,b,c;
++	int a = 0, b = 0,c = 0;
+ 	if (uname(&name) <0)
+ 		return -1;
+ 
+ 	cp = name.release;
+ 	a = strtoul(cp, &cp, 10);
+-	if (*cp != '.') return -1;
+-	b = strtoul(cp+1, &cp, 10);
+-	if (*cp != '.') return -1;
+-	c = strtoul(cp+1, NULL, 10);
++	if (*cp == '.')
++		b = strtoul(cp+1, &cp, 10);
++	if (*cp == '.')
++		c = strtoul(cp+1, &cp, 10);
+ 
+ 	return (a*1000000)+(b*1000)+c;
+ }
+-- 
+1.7.2.3
+




More information about the arch-commits mailing list