update to 3.1 [release 3.1-1mamba;Mon Mar 12 2012]

This commit is contained in:
Automatic Build System 2024-01-06 08:25:16 +01:00
parent 0c23f125e7
commit a104006ae0
7 changed files with 607 additions and 0 deletions

View File

@ -1,2 +1,5 @@
# parted
GNU Parted is a program for creating, destroying, resizing, checking and copying partitions, and the filesystems on them.
This is useful for creating space for new operating systems, reorganising disk usage, copying data between hard disks, and disk imaging.

View File

@ -0,0 +1,195 @@
diff -ru parted-1.6.21/python-parted-0.11.2/parted.py parted-1.6.21-fix/python-parted-0.11.2/parted.py
--- parted-1.6.21/python-parted-0.11.2/parted.py 2002-09-17 19:07:55.000000000 +0000
+++ parted-1.6.21-fix/python-parted-0.11.2/parted.py 2005-03-14 16:21:21.000000000 +0000
@@ -100,7 +100,23 @@
return self.list[i:j]
###############################################################################
-# PEDDEVICE
+# PEDCHSGEOMETRY, PEDDEVICE
+
+class CHSGeometry:
+ def __init__(self, obj):
+ self._o = obj
+
+ # Accessor Methods
+
+ def get_cylinders(self):
+ return _parted.chs_geometry_get_cylinders(self._o)
+
+ def get_heads(self):
+ return _parted.chs_geometry_get_heads(self._o)
+
+ def get_sectors(self):
+ return _parted.chs_geometry_get_sectors(self._o)
+
# Enum DeviceType
DEVICE_UNKNOWN = 0
@@ -143,17 +159,11 @@
def get_sector_size(self):
return _parted.device_get_sector_size(self._o)
- def get_heads(self):
- return _parted.device_get_heads(self._o)
-
- def get_sectors(self):
- return _parted.device_get_sectors(self._o)
-
- def get_cylinders(self):
- return _parted.device_get_cylinders(self._o)
+ def get_hw_geom(self):
+ return CHSGeometry(_parted.device_get_hw_geom(self._o))
- def get_geom_known(self):
- return _parted.device_get_geom_known(self._o)
+ def get_bios_geom(self):
+ return CHSGeometry(_parted.device_get_bios_geom(self._o))
def get_host(self):
return _parted.device_get_host(self._o)
diff -ru parted-1.6.21/python-parted-0.11.2/pyparted.c parted-1.6.21-fix/python-parted-0.11.2/pyparted.c
--- parted-1.6.21/python-parted-0.11.2/pyparted.c 2002-09-17 22:12:37.000000000 +0000
+++ parted-1.6.21-fix/python-parted-0.11.2/pyparted.c 2005-03-14 16:33:47.000000000 +0000
@@ -128,91 +128,104 @@
}
static PyObject *
-device_get_model(PyObject *self, PyObject *args)
+chs_geometry_get_cylinders(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyString_FromString(((PedDevice *)o->obj)->model);
+ return PyInt_FromLong(((PedCHSGeometry *)o->obj)->cylinders);
}
static PyObject *
-device_get_path(PyObject *self, PyObject *args)
+chs_geometry_get_heads(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyString_FromString(((PedDevice *)o->obj)->path);
+ return PyInt_FromLong(((PedCHSGeometry *)o->obj)->heads);
}
static PyObject *
-device_get_type(PyObject *self, PyObject *args)
+chs_geometry_get_sectors(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyInt_FromLong(((PedDevice *)o->obj)->type);
+ return PyInt_FromLong(((PedCHSGeometry *)o->obj)->sectors);
}
static PyObject *
-device_get_sector_size(PyObject *self, PyObject *args)
+device_get_model(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyInt_FromLong(((PedDevice *)o->obj)->sector_size);
+ return PyString_FromString(((PedDevice *)o->obj)->model);
}
static PyObject *
-device_get_heads(PyObject *self, PyObject *args)
+device_get_path(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyInt_FromLong(((PedDevice *)o->obj)->heads);
+ return PyString_FromString(((PedDevice *)o->obj)->path);
}
static PyObject *
-device_get_sectors(PyObject *self, PyObject *args)
+device_get_type(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyInt_FromLong(((PedDevice *)o->obj)->sectors);
+ return PyInt_FromLong(((PedDevice *)o->obj)->type);
+}
+
+static PyObject *
+device_get_sector_size(PyObject *self, PyObject *args)
+{
+ PyPartedObject *o;
+
+ if (!PyArg_ParseTuple(args, "O", &o))
+ return NULL;
+
+ return PyInt_FromLong(((PedDevice *)o->obj)->sector_size);
}
static PyObject *
-device_get_cylinders(PyObject *self, PyObject *args)
+device_get_hw_geom(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyInt_FromLong(((PedDevice *)o->obj)->cylinders);
+ return PyPartedObject_new("PedCHSGeometry",
+ &((PedDevice *)o->obj)->hw_geom);
}
static PyObject *
-device_get_geom_known(PyObject *self, PyObject *args)
+device_get_bios_geom(PyObject *self, PyObject *args)
{
PyPartedObject *o;
if (!PyArg_ParseTuple(args, "O", &o))
return NULL;
- return PyInt_FromLong(((PedDevice *)o->obj)->geom_known);
+ return PyPartedObject_new("PedCHSGeometry",
+ &((PedDevice *)o->obj)->bios_geom);
}
static PyObject *
@@ -1248,15 +1261,16 @@
static PyMethodDef parted_methods[] = {
{ "init", init, METH_VARARGS, NULL },
+ { "chs_geometry_get_cylinders", chs_geometry_get_cylinders, METH_VARARGS, NULL },
+ { "chs_geometry_get_heads", chs_geometry_get_heads, METH_VARARGS, NULL },
+ { "chs_geometry_get_sectors", chs_geometry_get_sectors, METH_VARARGS, NULL },
{ "device_get_next", device_get_next, METH_VARARGS, NULL },
{ "device_get_model", device_get_model, METH_VARARGS, NULL },
{ "device_get_path", device_get_path, METH_VARARGS, NULL },
{ "device_get_type", device_get_type, METH_VARARGS, NULL },
{ "device_get_sector_size", device_get_sector_size, METH_VARARGS, NULL },
- { "device_get_heads", device_get_heads, METH_VARARGS, NULL },
- { "device_get_sectors", device_get_sectors, METH_VARARGS, NULL },
- { "device_get_cylinders", device_get_cylinders, METH_VARARGS, NULL },
- { "device_get_geom_known", device_get_geom_known, METH_VARARGS, NULL },
+ { "device_get_hw_geom", device_get_hw_geom, METH_VARARGS, NULL },
+ { "device_get_bios_geom", device_get_bios_geom, METH_VARARGS, NULL },
{ "device_get_host", device_get_host, METH_VARARGS, NULL },
{ "device_get_did", device_get_did, METH_VARARGS, NULL },
{ "device_get_length", device_get_length, METH_VARARGS, NULL },

View File

@ -0,0 +1,11 @@
--- parted-1.8.6/libparted/labels/dos.c.orig 2007-03-13 18:01:09.000000000 +0100
+++ parted-1.8.6/libparted/labels/dos.c 2007-05-04 12:42:07.000000000 +0200
@@ -510,7 +510,7 @@
PedSector c, h, s, a, a_; /* start */
PedSector C, H, S, A, A_; /* end */
PedSector dont_overflow, denum;
- PedSector cyl_size, head_size;
+ PedSector cyl_size, head_size=0;
PedSector cylinders, heads, sectors;
PED_ASSERT (part != NULL, return 0);

View File

@ -0,0 +1,91 @@
--- parted-1.8.6/libparted/labels/sun.c.pix 2007-03-13 18:01:09.000000000 +0100
+++ parted-1.8.6/libparted/labels/sun.c 2007-04-20 11:07:10.000000000 +0200
@@ -86,6 +86,7 @@
int is_boot;
int is_root;
int is_lvm;
+ int is_raid;
};
struct _SunDiskData {
@@ -344,6 +345,7 @@
sun_data->type = label->infos[i].id;
sun_data->is_boot = sun_data->type == 0x1;
sun_data->is_root = sun_data->type == 0x2;
+ sun_data->is_raid = sun_data->type == 0xfd;
sun_data->is_lvm = sun_data->type == 0x8e;
part->num = i + 1;
@@ -479,6 +481,7 @@
sun_data->type = 0;
sun_data->is_boot = 0;
sun_data->is_root = 0;
+ sun_data->is_raid = 0;
sun_data->is_lvm = 0;
} else {
part->disk_specific = NULL;
@@ -512,6 +515,7 @@
new_sun_data->type = old_sun_data->type;
new_sun_data->is_boot = old_sun_data->is_boot;
new_sun_data->is_root = old_sun_data->is_root;
+ new_sun_data->is_raid = old_sun_data->is_raid;
new_sun_data->is_lvm = old_sun_data->is_lvm;
return new_part;
}
@@ -542,6 +546,10 @@
return 1;
}
if (sun_data->is_lvm) {
+ sun_data->type = 0xfd;
+ return 1;
+ }
+ if (sun_data->is_lvm) {
sun_data->type = 0x8e;
return 1;
}
@@ -572,19 +580,25 @@
case PED_PARTITION_BOOT:
sun_data->is_boot = state;
if (state)
- sun_data->is_root = sun_data->is_lvm = 0;
+ sun_data->is_root = sun_data->is_raid = sun_data->is_lvm = 0;
return ped_partition_set_system (part, part->fs_type);
case PED_PARTITION_ROOT:
sun_data->is_root = state;
if (state)
- sun_data->is_boot = sun_data->is_lvm = 0;
+ sun_data->is_boot = sun_data->is_raid = sun_data->is_lvm = 0;
+ return ped_partition_set_system (part, part->fs_type);
+
+ case PED_PARTITION_RAID:
+ sun_data->is_raid = state;
+ if (state)
+ sun_data->is_root = sun_data->is_boot = sun_data->is_lvm = 0;
return ped_partition_set_system (part, part->fs_type);
case PED_PARTITION_LVM:
sun_data->is_lvm = state;
if (state)
- sun_data->is_root = sun_data->is_boot = 0;
+ sun_data->is_root = sun_data->is_boot = sun_data->is_raid = 0;
return ped_partition_set_system (part, part->fs_type);
default:
@@ -608,6 +622,8 @@
return sun_data->is_boot;
case PED_PARTITION_ROOT:
return sun_data->is_root;
+ case PED_PARTITION_RAID:
+ return sun_data->is_raid;
case PED_PARTITION_LVM:
return sun_data->is_lvm;
@@ -625,6 +641,7 @@
case PED_PARTITION_BOOT:
case PED_PARTITION_ROOT:
case PED_PARTITION_LVM:
+ case PED_PARTITION_RAID:
return 1;
default:

View File

@ -0,0 +1,22 @@
diff -Nru parted-1.8.8.orig/configure parted-1.8.8/configure
--- parted-1.8.8.orig/configure 2007-08-09 20:49:21.000000000 +0200
+++ parted-1.8.8/configure 2008-02-12 02:37:04.000000000 +0100
@@ -12816,7 +12816,6 @@
# native cc issues annoying warnings and then ignores it,
# which would cause us to incorrectly conclude that it worked.
for gl_flags in \
- '-Wl,--as-needed' \
'-Wl,-z,ignore' \
'-z ignore'
do
diff -Nru parted-1.8.8.orig/m4/lib-ignore.m4 parted-1.8.8/m4/lib-ignore.m4
--- parted-1.8.8.orig/m4/lib-ignore.m4 2006-07-03 10:32:46.000000000 +0200
+++ parted-1.8.8/m4/lib-ignore.m4 2008-02-12 02:36:36.000000000 +0100
@@ -26,7 +26,6 @@
# native cc issues annoying warnings and then ignores it,
# which would cause us to incorrectly conclude that it worked.
for gl_flags in \
- '-Wl,--as-needed' \
'-Wl,-z,ignore' \
'-z ignore'
do

View File

@ -0,0 +1,17 @@
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);

268
parted.spec Normal file
View File

@ -0,0 +1,268 @@
### AUTOUPDATE-OFF: 2
%define pyb_ver 0.11.2
%define with_python_binding 1
%define libname lib%{name}
Name: parted
Version: 3.1
Release: 1mamba
Summary: Tools for creating, destroying, resizing, checking and copying partitions
Group: System/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.gnu.org/software/parted/
Source0: http://ftp.gnu.org/gnu/parted/parted-%{version}.tar.xz
%if %{with_python_binding}
Source1: http://archive.ubuntu.com/ubuntu/pool/main/p/python-parted/python-parted_%{pyb_ver}.tar.gz
Patch0: %{name}-1.6.21-python_parted_0.11.2.patch
%endif
Patch1: %{name}-1.8.6-disk_dos.patch
Patch2: %{name}-1.8.8-readline.patch
Patch3: %{name}-1.8.6-disk_sun_raid.patch
Patch4: %{name}-2.4-kernel-3.0.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: bash
BuildRequires: glibc-devel
BuildRequires: libdevmapper-devel
BuildRequires: libe2fs-devel
BuildRequires: libncurses-devel
BuildRequires: libreadline-devel
%if "%{stage1}" != "1"
BuildRequires: libselinux-devel
%endif
BuildRequires: libsepol-devel
BuildRequires: texinfo
## AUTOBUILDREQ-END
BuildRequires: libreiserfs-devel >= 0.3.0.4
BuildRequires: gettext-devel
BuildRequires: libcheck-devel
Requires(post):%{__install_info}
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
GNU Parted is a program for creating, destroying, resizing, checking and copying partitions, and the filesystems on them.
This is useful for creating space for new operating systems, reorganising disk usage, copying data between hard disks, and disk imaging.
%package -n %{libname}
Group: System/Libraries
Summary: Dinamic libraries for parted
%description -n %{libname}
GNU Parted is a program for creating, destroying, resizing, checking and copying partitions, and the filesystems on them.
This is useful for creating space for new operating systems, reorganising disk usage, copying data between hard disks, and disk imaging.
This package contains the dynamic libraries.
%package -n %{libname}-devel
Group: Development/Libraries
Summary: Static libraries and header for parted
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
%description -n %{libname}-devel
GNU Parted is a program for creating, destroying, resizing, checking and
copying partitions, and the filesystems on them.
This is useful for creating space for new operating systems, reorganising disk usage, copying data between hard disks, and disk imaging.
This package contains static libraries and header files need for development.
%if %{with_python_binding}
%package python
Group: Development/Libraries/Python
Summary: Python bindings for GNU parted
Requires: python >= %{pyver}
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
%description python
GNU Parted is a program for creating, destroying, resizing, checking and copying partitions, and the filesystems on them.
This is useful for creating space for new operating systems, reorganising disk usage, copying data between hard disks, and disk imaging.
This module contains Python bindings for the library.
%endif
%prep
%setup -q
%patch1 -p1
#%patch2 -p1
#%patch3 -p1
#%patch4 -p1
%if %{with_python_binding}
gzip -cd %{S:1} | tar xf -
%patch0 -p1
%endif
%build
#autoconf
%configure \
--enable-device-mapper \
%if "%{stage1}" != "1"
--enable-selinux \
%endif
--disable-Werror
%make
%if %{with_python_binding}
pushd python-%{name}-%{pyb_ver}
CFLAGS="-L../lib%{name}/.libs -I../include" %{__python} setup.py build
popd
%endif
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
rm -f %{buildroot}%{_bindir}/label
%find_lang %{name}
%if %{with_python_binding}
pushd python-%{name}-%{pyb_ver}
%{__python} setup.py install \
--root=%{buildroot} \
--install-headers=%{_includedir}/python \
--install-lib=%{python_sitearch}
chmod 644 {AUTHORS,README,TODO}
popd
%endif
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post
%install_info %{name}.info
%preun
%uninstall_info %{name}.info
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files -f %{name}.lang
%defattr(-,root,root)
#%{_bindir}/disk
%{_sbindir}/%{name}
%{_sbindir}/partprobe
%{_infodir}/*
%{_mandir}/man8/*
%doc AUTHORS BUGS ChangeLog COPYING NEWS README THANKS TODO
%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/%{libname}*.so.*
%files -n %{libname}-devel
%defattr(-,root,root)
%{_includedir}/%{name}/*
%{_libdir}/%{libname}*.a
%{_libdir}/%{libname}*.la
%{_libdir}/%{libname}*.so
%{_libdir}/pkgconfig/%{libname}.pc
%if %{with_python_binding}
%files python
%defattr(-,root,root)
%{python_sitearch}/_%{name}module.so
%{python_sitearch}/%{name}.py
%{python_sitearch}/%{name}.pyc
%{python_sitearch}/python_parted-*-py*.egg-info
%doc python-%{name}-%{pyb_ver}/{AUTHORS,README,TODO}
%endif
%changelog
* Mon Mar 12 2012 Automatic Build System <autodist@mambasoft.it> 3.1-1mamba
- update to 3.1
* Mon Mar 12 2012 Automatic Build System <autodist@mambasoft.it> 3.0-1mamba
- automatic version update by autodist
* Mon Sep 26 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.4-2mamba
- added a patch to prevent a crash with kernel 3.0
* Thu May 19 2011 Automatic Build System <autodist@mambasoft.it> 2.4-1mamba
- automatic update by autodist
* Sat May 29 2010 Automatic Build System <autodist@mambasoft.it> 2.3-1mamba
- automatic update to 2.3 by autodist
* Fri Mar 12 2010 Automatic Build System <autodist@mambasoft.it> 2.2-1mamba
- automatic update to 2.2 by autodist
* Wed Jan 13 2010 Automatic Build System <autodist@mambasoft.it> 2.1-1mamba
- automatic update to 2.1 by autodist
* Sat Jul 25 2009 Automatic Build System <autodist@mambasoft.it> 1.9.0-1mamba
- update to 1.9.0
* Tue Feb 12 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8.8-1mamba
- update to 1.8.8
* Fri May 04 2007 Stefano Cotta Ramusino <stefano.cotta@openmamba.org> 1.8.6-1mamba
- update to 1.8.6
* Mon Jul 24 2006 Silvan Calarco <silvan.calarco@mambasoft.it> 1.7.1-1qilnx
- update to version 1.7.1 by autospec
* Mon Jul 24 2006 Silvan Calarco <silvan.calarco@mambasoft.it> 1.7.0-1qilnx
- update to version 1.7.0 by autospec
* Wed Apr 12 2006 Silvan Calarco <silvan.calarco@mambasoft.it> 1.7.0rc4-1qilnx
- update to version 1.7.0rc4 by autospec
* Wed Apr 12 2006 Silvan Calarco <silvan.calarco@mambasoft.it> 1.6.25.1-3qilnx
- add patch to set the proper GUID on HFS/HFS+ partitions
* Fri Mar 03 2006 Stefano Cotta Ramusino <stefano.cotta@qilinux.it> 1.6.25.1-2qilnx
- specfile fixed and updated
- fixed building without python binding
* Thu Nov 17 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.25.1-1qilnx
- update to version 1.6.25.1 by autospec
* Wed Nov 09 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.25-2qilnx
- build requires libreiserfs-devel
* Wed Nov 09 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.25-1qilnx
- update to version 1.6.25 by autospec
* Sat Aug 13 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 1.6.24-1qilnx
- update to version 1.6.24 by autospec
- fix python binding build dir library linking
* Tue Apr 19 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.22-3qilnx
- fixed permissions in python-parted documentation
* Mon Apr 18 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.22-2qilnx
- parted-python requires python
* Wed Apr 13 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.22-1qilnx
- update to version 1.6.22 by autospec
- added %%post and %%postun scripts to install/uninstall info files
* Thu Mar 17 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.21-3qilnx
- fixed some typos errors in the specfile
- python package made conditionally enabled/disabled
* Mon Mar 14 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.21-2qilnx
- added python bindings
* Mon Mar 14 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.21-1qilnx
- update to version 1.6.21 by autospec
- added missing build requirements: ncurses-devel
* Mon Nov 22 2004 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.18-1qilnx
- update to version 1.6.18 by autospec
* Fri Sep 24 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 1.6.15-1qilnx
- update to version 1.6.15 by autospec
* Wed Jul 28 2004 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.11-1qilnx
- update to 1.6.11
* Thu Mar 25 2004 Davide Madrisan <davide.madrisan@qilinux.it> 1.6.6-1qilnx
- first build