[pyparted/f15] Bring in patch for PED_PARTITION_LEGACY_BOOT from master git branch (#711573)
David Cantrell
dcantrel at fedoraproject.org
Wed Jun 8 19:20:30 UTC 2011
commit 1449e4a62e8f9676b60a1cf9795960348f74b026
Author: David Cantrell <dcantrell at redhat.com>
Date: Wed Jun 8 15:13:07 2011 -0400
Bring in patch for PED_PARTITION_LEGACY_BOOT from master git branch (#711573)
bf5bd64438a5ffbc6083853c96ff5078450b5eaa.patch | 79 ++++++++++++++++++++++++
pyparted.spec | 8 ++-
2 files changed, 85 insertions(+), 2 deletions(-)
---
diff --git a/bf5bd64438a5ffbc6083853c96ff5078450b5eaa.patch b/bf5bd64438a5ffbc6083853c96ff5078450b5eaa.patch
new file mode 100644
index 0000000..44f6a69
--- /dev/null
+++ b/bf5bd64438a5ffbc6083853c96ff5078450b5eaa.patch
@@ -0,0 +1,79 @@
+commit bf5bd64438a5ffbc6083853c96ff5078450b5eaa
+Author: David Cantrell <dcantrell at redhat.com>
+Date: Thu Mar 17 16:28:32 2011 -1000
+
+ Add support for PED_PARTITION_LEGACY_BOOT flag.
+
+ This is currently in the master branch for upstream parted and is part
+ of the parted package in Fedora rawhide. The latest stable release of
+ parted is 2.3. Since we cannot depend on the library version to know if
+ PED_PARTITION_LEGACY_BOOT is defined, add in a special check for that
+ constant and enable it in _ped and parted if it's present.
+
+diff --git a/configure.ac b/configure.ac
+index 8517a5f..e70ebe8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -18,7 +18,7 @@ dnl Red Hat, Inc.
+ dnl
+ dnl Red Hat Author(s): David Cantrell <dcantrell at redhat.com>
+
+-m4_define(libparted_required_version, 2.2)
++m4_define(libparted_required_version, 2.3)
+ m4_define(python_required_version, 2.7)
+
+ AC_PREREQ(2.59)
+@@ -46,5 +46,6 @@ AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers or library)
+
+ dnl Check for GNU parted
+ AM_CHECK_LIBPARTED(libparted_required_version)
++AM_CHECK_PED_PARTITION_LEGACY_BOOT
+
+ AC_OUTPUT
+diff --git a/m4/libparted.m4 b/m4/libparted.m4
+index 375cf40..6f16d96 100644
+--- a/m4/libparted.m4
++++ b/m4/libparted.m4
+@@ -36,3 +36,13 @@ LIBPARTED_LIBS="$(pkg-config --libs libparted)"
+
+ LIBPARTED_VERSION=$1
+ ])
++
++dnl Check for PED_PARTITION_LEGACY_BOOT in parted header files
++AC_DEFUN([AM_CHECK_PED_PARTITION_LEGACY_BOOT],[
++ AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM([[#include <parted/parted.h]],
++ [[int flag = PED_PARTITION_LEGACY_BOOT;]])],
++ [AC_DEFINE([HAVE_PED_PARTITION_LEGACY_BOOT], [1],
++ [Define if libparted has 'PED_PARTITION_LEGACY_BOOT' constant.])],
++ [])
++])
+diff --git a/src/_pedmodule.c b/src/_pedmodule.c
+index 6e426e4..85dc54d 100644
+--- a/src/_pedmodule.c
++++ b/src/_pedmodule.c
+@@ -492,6 +492,9 @@ PyMODINIT_FUNC init_ped(void) {
+ PyModule_AddIntConstant(m, "PARTITION_APPLE_TV_RECOVERY", PED_PARTITION_APPLE_TV_RECOVERY);
+ PyModule_AddIntConstant(m, "PARTITION_BIOS_GRUB", PED_PARTITION_BIOS_GRUB);
+ PyModule_AddIntConstant(m, "PARTITION_DIAG", PED_PARTITION_DIAG);
++#ifdef HAVE_PED_PARTITION_LEGACY_BOOT
++ PyModule_AddIntConstant(m, "PARTITION_LEGACY_BOOT", PED_PARTITION_LEGACY_BOOT);
++#endif
+
+ PyModule_AddIntConstant(m, "DISK_CYLINDER_ALIGNMENT", PED_DISK_CYLINDER_ALIGNMENT);
+
+diff --git a/src/parted/__init__.py b/src/parted/__init__.py
+index 474825f..dc631b6 100644
+--- a/src/parted/__init__.py
++++ b/src/parted/__init__.py
+@@ -109,6 +109,10 @@ from _ped import PARTITION_MSFT_RESERVED
+ from _ped import PARTITION_APPLE_TV_RECOVERY
+ from _ped import PARTITION_BIOS_GRUB
+ from _ped import PARTITION_DIAG
++try:
++ from _ped import PARTITION_LEGACY_BOOT
++except ImportError:
++ pass
+
+ from _ped import DISK_CYLINDER_ALIGNMENT
+
diff --git a/pyparted.spec b/pyparted.spec
index 53e5e5a..9f12beb 100644
--- a/pyparted.spec
+++ b/pyparted.spec
@@ -3,16 +3,17 @@
Summary: Python module for GNU parted
Name: pyparted
Version: 3.5
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: http://fedorahosted.org/pyparted
Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz
+Patch0: bf5bd64438a5ffbc6083853c96ff5078450b5eaa.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
BuildRequires: python-devel
-BuildRequires: parted-devel >= 2.1
+BuildRequires: parted-devel >= 2.3
BuildRequires: pkgconfig
%description
@@ -41,6 +42,9 @@ rm -rf %{buildroot}
%{python_sitearch}/parted
%changelog
+* Wed Jun 08 2011 David Cantrell <dcantrell at redhat.com> - 3.5-3
+- Bring in patch for PED_PARTITION_LEGACY_BOOT from master git branch (#711573)
+
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
More information about the scm-commits
mailing list