Blob Blame History Raw
From d8a1ed4a28dfb8541b95b3635660dfe18fa37a19 Mon Sep 17 00:00:00 2001
From: root <hamzy@us.ibm.com>
Date: Thu, 8 May 2014 15:32:51 -0500
Subject: [PATCH 1/7] support ppc64le in pyparted

Add ppc64le support to pyparted
---
 src/parted/__init__.py      | 6 ++++--
 tests/test_parted_parted.py | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/parted/__init__.py b/src/parted/__init__.py
index 8208c75..ae7bc4b 100644
--- a/src/parted/__init__.py
+++ b/src/parted/__init__.py
@@ -278,6 +278,8 @@ archLabels = {'i386': ['msdos', 'gpt'],
               'sparc': ['sun'],
               'ia64': ['msdos', 'gpt'],
               'ppc': ['msdos', 'mac', 'amiga', 'gpt'],
+              'ppc64': ['msdos', 'mac', 'amiga', 'gpt'],
+              'ppc64le': ['msdos', 'gpt'],
               'x86_64': ['msdos', 'gpt'],
               'aarch64': ['msdos', 'gpt']}
 
@@ -313,9 +315,9 @@ def Deprecated(mod, deprecated={}):
 __archLabels = (('amiga', 'ppc(64)?$'),
                 ('bsd', 'alpha$'),
                 ('dasd', 's390x?$'),
-                ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64)?$|aarch64$'),
+                ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64|64le)?$|aarch64$'),
                 ('mac', 'ppc(64)?$'),
-                ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64)?$|aarch64$'),
+                ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64|64le)?$|aarch64$'),
                 ('sun', 'sparc(64)?$'))
 
 def getLabels(arch=None):
diff --git a/tests/test_parted_parted.py b/tests/test_parted_parted.py
index 29aeb10..b2db935 100755
--- a/tests/test_parted_parted.py
+++ b/tests/test_parted_parted.py
@@ -57,6 +57,7 @@ class GetLabelsTestCase(unittest.TestCase):
         self.assertSetEqual(parted.getLabels('sparc64'), {'sun'})
         self.assertSetEqual(parted.getLabels('ppc'), {'amiga', 'gpt', 'mac', 'msdos'})
         self.assertSetEqual(parted.getLabels('ppc64'), {'amiga', 'gpt', 'mac', 'msdos'})
+        self.assertSetEqual(parted.getLabels('ppc64le'), {'gpt', 'msdos'})
         self.assertSetEqual(parted.getLabels('alpha'), {'bsd', 'msdos'})
         self.assertSetEqual(parted.getLabels('ia64'), {'gpt', 'msdos'})
         self.assertSetEqual(parted.getLabels('aarch64'), {'gpt', 'msdos'})
-- 
1.8.3.1