dcantrell / pyparted

Python bindings for GNU parted (libparted)
GNU General Public License v2.0
85 stars 42 forks source link

Newer partition flags are not available in pyparted >= 3.11.6 #80

Closed vojtechtrefny closed 2 years ago

vojtechtrefny commented 3 years ago

I'm trying to use the PARTITION_ESP flag which seems to be broken in pyparted 3.11.6 and newer. It wasn't available in 3.11.4 which was fixed in 3.11.5 in https://github.com/dcantrell/pyparted/pull/69/commits/9c3809bd5d980674ea1e0edd49ec6cf8e1719f50 but the second fix in https://github.com/dcantrell/pyparted/commit/85a76d882a122df252558eaed61340632dab9cb1 again removed the PARTITION_ESP flag (actually are flags > 15 that are supported conditionally). I'm not sure what was the issue with the original fix using the PED_PARTITION_LAST_FLAG but it looks like the define preprocess operator also doesn't work.

russdill commented 2 years ago

It's because these flags are an enum:

https://github.com/bcl/parted/blob/master/include/parted/disk.in.h#L85

if defined() will not have the desired effect.