rescatux / rescapp

Rescapp - Rescatux's wizard for rescue tasks
GNU General Public License v3.0
32 stars 15 forks source link

Flag detection fails for drives with name /dev/nvme0n1 #67

Open caph1993 opened 4 years ago

caph1993 commented 4 years ago

My main SSD has this name: /dev/nvme0n1, and the partitions are named /dev/nvme0n1p1, /dev/nvme0n1p2, etc. Although weird, it is standard in some systems.

On the file rescapp-show-partition-flags, the line flag_disk_str=re.sub(r'[0-9]*$', '', flag_partition_str) ends up with /dev/nvme0n1p, which is not the drive location because the last p should not be there.

pfroide commented 4 years ago

Hi.

Did you find a workaround for this ?

caph1993 commented 4 years ago

Yes, I did. I do not have the code and I can not test it now, but I guess this was it:


flag_disk_str=re.sub(r'[0-9]*$', '', flag_partition_str)

if flag_disk_str.endswith('/nvme0n1p'):
    flag_disk_str = flag_disk_str[:-1] # remove the p and get nvme0n1
seekstar commented 2 years ago

I think a more elegant way is to find a device with the longest name in /dev/ that is a prefix of /dev/nvme0n1p2 and does not end with digits.

seekstar commented 2 years ago

Could anybody fix it? I can't even get rescapp work in my distro. It reports the error:

Traceback (most recent call last):
  File "/usr/local/bin/rescapp", line 27, in <module>
    from PyQt5 import QtGui, QtCore, QtWebKit, QtWidgets, QtWebKitWidgets
ImportError: cannot import name 'QtWebKit' from 'PyQt5' (/home/searchstar/.local/lib/python3.7/site-packages/PyQt5/__init__.py)

I have installed all required packages in INSTALL:

sudo apt install $RESCAPP_PACKAGES

Edit: This QtWebKit issue is fixed in my PR #73.

seekstar commented 2 years ago

Hey, I fixed this issue in #74! You may check it out! Although it might be too late for you hhh

adrian15 commented 1 year ago

I'll take into account your pr.

It relies a lot on python but maybe it's the way to go... move everything into python. Not sure about that though.