5 commits - liveusb-creator liveusb/creator.py liveusb-creator.spec setup.py

Luke Macken lmacken at fedoraproject.org
Wed Mar 18 04:13:23 UTC 2009


 liveusb-creator      |    2 +-
 liveusb-creator.spec |   10 ++++++++--
 liveusb/creator.py   |   43 ++++++++++++++++---------------------------
 setup.py             |    4 ++--
 4 files changed, 27 insertions(+), 32 deletions(-)

New commits:
commit c6c393d7f0cc645f8cb734220c1317938e72e469
Author: Luke Macken <lmacken at redhat.com>
Date:   Wed Mar 18 00:12:30 2009 -0400

    v3.6.4

diff --git a/liveusb-creator b/liveusb-creator
index aaf7f86..72bb80c 100755
--- a/liveusb-creator
+++ b/liveusb-creator
@@ -18,7 +18,7 @@
 #
 # Author(s): Luke Macken <lmacken at redhat.com>
 
-__version__ = '3.6.3'
+__version__ = '3.6.4'
 
 def parse_args():
     from optparse import OptionParser
diff --git a/liveusb-creator.spec b/liveusb-creator.spec
index df0315e..ec2fcd7 100644
--- a/liveusb-creator.spec
+++ b/liveusb-creator.spec
@@ -1,7 +1,7 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 Name:           liveusb-creator
-Version:        3.6.3
+Version:        3.6.4
 Release:        1%{?dist}
 Summary:        A liveusb creator
 
@@ -68,6 +68,9 @@ rm -rf %{buildroot}
 %config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
 
 %changelog
+* Wed Mar 18 2009 Luke Macken <lmacken at redhat.com> 3.6.4-1
+- Update to v3.6.4, which works with the PyParted 2.0 API
+
 * Thu Mar 12 2009 Luke Macken <lmacken at redhat.com> 3.6.3-1
 - Update to v3.6.3
 
diff --git a/setup.py b/setup.py
index cbdc143..0b0a07d 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ if sys.platform == 'win32':
 
     setup(
         name = 'liveusb-creator',
-        version = '3.6.3',
+        version = '3.6.4',
         packages = ['liveusb', 'liveusb/urlgrabber'],
         scripts = ['liveusb-creator'], 
         license = 'GNU General Public License (GPL)',
@@ -55,7 +55,7 @@ if sys.platform == 'win32':
 else:
     setup(
         name = 'liveusb-creator',
-        version = '3.6.3',
+        version = '3.6.4',
         packages = ['liveusb'],
         scripts = ['liveusb-creator'],
         license = 'GNU General Public License (GPL)',


commit b9d70a41e2632bc7429614995ea8e6cc334ffeec
Author: Jeremy Katz <katzj at redhat.com>
Date:   Mon Mar 16 20:11:55 2009 -0400

    Fix up to work with new pyparted
    
    pyparted 2.x changed the API substantially.  Adjust so that we can work
    with the new API

diff --git a/liveusb-creator.spec b/liveusb-creator.spec
index 4c499ea..df0315e 100644
--- a/liveusb-creator.spec
+++ b/liveusb-creator.spec
@@ -18,7 +18,7 @@ ExcludeArch:    ppc64
 BuildRequires:  python-devel, python-setuptools, PyQt4-devel, desktop-file-utils gettext
 Requires:       syslinux, PyQt4, usermode, isomd5sum
 Requires:       python-urlgrabber
-Requires:       pyparted
+Requires:       pyparted >= 2.0
 
 %description
 A liveusb creator from Live Fedora images
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 85171a7..c1bb518 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -614,40 +614,29 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
     def bootable_partition(self):
         """ Ensure that the selected partition is flagged as bootable """
         import parted
-        disk, partition, name = self.get_disk_partition()
-        if partition.is_flag_available(parted.PARTITION_BOOT):
-            if partition.get_flag(parted.PARTITION_BOOT):
-                self.log.debug('%s already bootable' % name)
+        disk, partition = self.get_disk_partition()
+        if partition.isFlagAvailable(parted.PARTITION_BOOT):
+            if partition.getFlag(parted.PARTITION_BOOT):
+                self.log.debug('%s already bootable' % self._drive)
             else:
-                partition.set_flag(parted.PARTITION_BOOT, 1)
+                partition.setFlag(parted.PARTITION_BOOT)
                 disk.commit()
-                self.log.info('Marked %s as bootable' % name)
+                self.log.info('Marked %s as bootable' % self._drive)
         else:
-            self.log.warning('%s does not have boot flag' % name)
-
-    def get_partitions(self, disk):
-        """ Return a list of partitions on a given parted.PedDisk """
-        partitions = []
-        part = disk.next_partition()
-        while part:
-            if part.type_name in ("metadata", "free"):
-                part = disk.next_partition(part)
-                continue
-            partitions.append(part)
-            part = disk.next_partition(part)
-        return partitions
+            self.log.warning('%s does not have boot flag' % self._drive)
 
     def get_disk_partition(self):
         """ Return the PedDisk and partition of the selected device """
         import parted
         parent = self.drives[self._drive]['parent']
-        dev = parted.PedDevice.get(parent)
-        disk = parted.PedDisk.new(dev)
-        partitions = self.get_partitions(disk)
-        for part in partitions:
-            name = '%s%d' % (parent, part.num)
-            if name == self._drive:
-                return disk, part, name
+        dev = parted.Device(path = parent)
+        disk = parted.Disk(device = dev)
+        print self._drive
+        for part in disk.partitions:
+            print part.getDeviceNodeName()
+            if self._drive == "/dev/%s" %(part.getDeviceNodeName(),):
+                return disk, part
+        raise LiveUSBError(_("Unable to find partition"))
 
     def initialize_zip_geometry(self):
         """ This method initializes the selected device in a zip-like fashion.
@@ -658,7 +647,7 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
         More details on this can be found here:
             http://syslinux.zytor.com/doc/usbkey.txt
         """
-        from parted import PedDevice
+        #from parted import PedDevice
         self.log.info('Initializing %s in a zip-like fashon' % self._drive)
         heads = 64
         cylinders = 32


commit 528c17def46935c6dfd8d8cf7a67acf4a9e518ab
Merge: b0edaa6... 1665152...
Author: Luke Macken <lmacken at redhat.com>
Date:   Tue Mar 17 23:50:40 2009 -0400

    Merge branch 'master' of ssh://git.fedorahosted.org/git/liveusb-creator



commit b0edaa6ee4dea5bee08ab8c4adee54d1f11abb3a
Merge: 671da1f... 3ca395c...
Author: Luke Macken <lmacken at redhat.com>
Date:   Thu Mar 12 20:21:42 2009 -0400

    Merge branch 'master' of ssh://git.fedorahosted.org/git/liveusb-creator



commit 671da1fabe4df6afd9069ac5c536bf8b9a81a47c
Author: Luke Macken <lmacken at redhat.com>
Date:   Thu Mar 12 20:18:19 2009 -0400

    Update to v3.6.3

diff --git a/liveusb-creator b/liveusb-creator
index 0755693..aaf7f86 100755
--- a/liveusb-creator
+++ b/liveusb-creator
@@ -18,7 +18,7 @@
 #
 # Author(s): Luke Macken <lmacken at redhat.com>
 
-__version__ = '3.6.2'
+__version__ = '3.6.3'
 
 def parse_args():
     from optparse import OptionParser
diff --git a/liveusb-creator.spec b/liveusb-creator.spec
index fa2abae..4c499ea 100644
--- a/liveusb-creator.spec
+++ b/liveusb-creator.spec
@@ -1,7 +1,7 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 Name:           liveusb-creator
-Version:        3.6
+Version:        3.6.3
 Release:        1%{?dist}
 Summary:        A liveusb creator
 
@@ -68,6 +68,9 @@ rm -rf %{buildroot}
 %config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
 
 %changelog
+* Thu Mar 12 2009 Luke Macken <lmacken at redhat.com> 3.6.3-1
+- Update to v3.6.3
+
 * Mon Mar 07 2009 Luke Macken <lmacken at redhat.com> 3.6-1
 - Require pyparted
 - Update to v3.6
diff --git a/setup.py b/setup.py
index 429b0a7..cbdc143 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ if sys.platform == 'win32':
 
     setup(
         name = 'liveusb-creator',
-        version = '3.6.2',
+        version = '3.6.3',
         packages = ['liveusb', 'liveusb/urlgrabber'],
         scripts = ['liveusb-creator'], 
         license = 'GNU General Public License (GPL)',
@@ -55,7 +55,7 @@ if sys.platform == 'win32':
 else:
     setup(
         name = 'liveusb-creator',
-        version = '3.6.2',
+        version = '3.6.3',
         packages = ['liveusb'],
         scripts = ['liveusb-creator'],
         license = 'GNU General Public License (GPL)',




More information about the liveusb-creator mailing list