diff options
author | Papoteur <papoteur@mageia.org> | 2020-12-23 18:30:18 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2020-12-23 18:30:18 +0100 |
commit | 59b94d431df1c7efc733cdd49bbc4b44a0153418 (patch) | |
tree | e7f4bd9ad04c3b8920fe5fd11b62ab8c5cdd740a | |
parent | 0481230a0c998c553845354d2407232b46649741 (diff) | |
parent | 80de1c22c863634cd8dafbf2eb8416d60d2579de (diff) | |
download | isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar.gz isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar.bz2 isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar.xz isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.zip |
Merge branch 'master' into topic/newgui
-rw-r--r-- | CHANGELOG | 10 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 9 | ||||
-rwxr-xr-x | backend/raw_write.py | 12 | ||||
-rwxr-xr-x | lib/isodumper.py | 48 | ||||
-rw-r--r-- | po/el.po | 22 |
6 files changed, 73 insertions, 30 deletions
@@ -1,10 +1,14 @@ The modifications are: +IsoDumper 1.31 +-------------- + - Fix display of warning -IsoDumper 1.29 +IsoDumper 1.30 -------------- - - Fix logging when ~/.isodumper doesn't exist + - Verify signatures also when they are detached (mga#27667) + - Display warning instead of success when sums or signatures doesn't match (mga#27667) -IsoDumper 1.28 +IsoDumper 1.29 -------------- - Fix creating ~/.isodumper for logging when not yet existing @@ -33,7 +33,7 @@ DBUSDIR=$(SYSCONFDIR)/dbus-1 SYSTEMDCONFDIR=$(LIBDIR)/systemd/system/ PACKAGE = isodumper -VERSION = 1.29 +VERSION = 1.31 GITPATH = git://git.mageia.org/software/isodumper all: version dirs pofiles @@ -19,12 +19,19 @@ Requirements - python3-parted - python3-pydbus - udisks2 -- libyui and declanation of ncurses, gtk or Qt +- libyui and declanation of ncurses, gtk or Qt, python bindings - libyui-mga - cryptsetup - fdisk - e2fsprogs +- python3-gnupg +- python3-manatools +Some explanations +----------------- +The application comprises two parts: a GUI and a backend, called magiback. +The GUI run in user mode, and call backend feature over DBUS. The backend run as deamon using systemd service and is launched as needed. The authorization is called to run the backend. +Logs of the backend are stored in /var/log/magiback.log License -------- diff --git a/backend/raw_write.py b/backend/raw_write.py index 154b2ad..fefa9b1 100755 --- a/backend/raw_write.py +++ b/backend/raw_write.py @@ -119,14 +119,15 @@ class Dumper(object): return ifc.close() self._progress = 100 - self.finished.set() self.return_state = True self.return_message = _("Writing terminated") logging.debug(self.return_message) + self.finished.set() return def _get_sum(self, source): self.return_state = False + self.signature_checked = FalseS logging.debug("Starting getting sum") # Check if the sum file has a valid signature gpg = gnupg.GPG() @@ -174,7 +175,6 @@ class Dumper(object): def _check_write(self, target, source): logging.debug("Start checking") - self.return_state = False self.return_message = "" b = os.path.getsize(source) # Compute the sum from the written device @@ -198,30 +198,32 @@ class Dumper(object): sha512func.update(block) sha512sumcalc=sha512func.hexdigest().upper() f.close() + self.return_state = True if self.signature_found and not self.signature_checked: #, keep the pourcent, this is the place for source file name self.return_message = _('Invalid signature for %s')%self.source_file + self.return_state = False if (self.sum_check == "") : # Can't get stored sum self.return_message += _('SHA3 sum: {}').format(sha512sumcalc) # compare the sums elif (sha512sumcalc == self.sum_check) : - if self.signature_checked: + if self.signature_checked and self.signature_found: #, keep the bracket, this is the place for sum type self.return_message +="\n" + _("The {} sum check is OK and the sum is signed").format(self.sum_type) else : if self.signature_found: self.return_message +="\n" + _("The signature of the sum is false !").format(self.sum_type) + self.return_state = False else: #, keep the bracket, this is the place for sum type self.return_message +="\n" + _("The {} sum check is OK but the signature can't be found").format(self.sum_type) else: self.return_message +="\n" + _("/!\\The computed and stored sums don't match") + self.return_state = False #except: #pass self._progress = 100 - logging.info(self.return_message) - self.return_state = True self.finished.set() def udev_wait(self, operation): diff --git a/lib/isodumper.py b/lib/isodumper.py index 12b3eb5..2f58d6b 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -25,11 +25,9 @@ # Requires python3-parted -# ensure we're using the latest build, if called from our build environment + import sys import importlib -import logging - try: from isodumper import version except: @@ -49,6 +47,10 @@ import gettext from subprocess import Popen, PIPE from pydbus import SystemBus +import logging +import threading +from gi.repository import GLib +from queue import SimpleQueue import psutil import manatools.args as args import manatools.ui.common as common @@ -163,7 +165,7 @@ class ParseCLI(args.AppArgs): class IsoDumper(basedialog.BaseDialog): - def get_devices(self): + def get_devices(self, selected=None): self.list = self.u.find_devices() while len(self.list) == 0: if self.nodevDialog(): @@ -174,7 +176,9 @@ class IsoDumper(basedialog.BaseDialog): if len(self.list) > 0: for name, path, size in self.list: if size != 0: - self.devicelist.addItem(str(name + ' (' + path.lstrip() + ') ' + self.sizeof_fmt(size)), False) + label = str(name + ' (' + path.lstrip() + ') ' + self.sizeof_fmt(size)) + sel = (label == selected) if selected else False + self.devicelist.addItem(label, sel) return True def active_signal(self): @@ -213,10 +217,19 @@ class IsoDumper(basedialog.BaseDialog): self.dialog.recalcLayout() self.restore() +<<<<<<< HEAD def refresh_signal(self, device, params): print("Refresh ", device) self.devicelist.deleteAllItems() self.get_devices() +======= + def update_list_on_event(self): + selitem = self.devicelist.selectedItem().label() + self.devicelist.deleteAllItems() + self.get_devices(selected = selitem) + if self.devicelist.selectedItem().label() != selitem: + self.restore() +>>>>>>> master self.dialog.recalcLayout() def device_selected(self): @@ -435,13 +448,13 @@ class IsoDumper(basedialog.BaseDialog): self.dialog.pollEvent() # Checking iface.check_write(target, source) - progress = iface.progress + progress = 0 while progress < 100: - progress = iface.progress self.progress.setValue(progress) self.dialog.pollEvent() time.sleep(.5) - success, message = iface.end() + progress = iface.progress + nowarning, message = iface.end() self.progress.setEnabled() self.logger(message) logging.info(message) @@ -485,7 +498,10 @@ class IsoDumper(basedialog.BaseDialog): self.udev_wait(_("unmounting")) if success: self.u.eject(target) - self.success() + if nowarning : + self.success() + else: + self.warn() else: self.emergency(message) self.restore() @@ -507,6 +523,16 @@ class IsoDumper(basedialog.BaseDialog): if self.ask_OK(info): return + def warn(self): + self.operation = False + self.final_unsensitive() + info = Info(_("Warning"), True, _("The operation completed, but with anomalies.\n\ + Check carefully the messages in log view.\n\ + You are free to unplug it now, a logfile \n\ +(/home/-user- or /root)/.isodumper/isodumper.log will be saved when\n\ + you close the application.")) + if self.ask_OK(info): + return def confirm_close(self, *args): if not self.operation: # no writing , backup nor format running self.close() @@ -546,6 +572,8 @@ class IsoDumper(basedialog.BaseDialog): def close(self): self.dialog.destroy() self.dialog = None + self.glib_loop.quit() + self.glib_thread.join() def logger(self, text): self.logview.appendLines(text + "\n") @@ -741,6 +769,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self.active_signal() self.device_selected() self.dialog.recalcLayout() + self.uEventQueue = SimpleQueue() self.glib_loop = GLib.MainLoop() self.glib_thread = threading.Thread(target=self.glib_mainloop, args=(self.glib_loop,)) @@ -879,6 +908,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog self._running = True self.timeout = 100 + try: self._handleEvents() except Exception: @@ -8,18 +8,18 @@ # Dimitrios Glentadakis <dglent@free.fr>, 2018 # dtsiamasiotis <dtsiamasiotis@gmail.com>, 2013-2014 # FIRST AUTHOR <EMAIL@ADDRESS>, 2008 -# Δημήτρης Σπέντζος <jimspentzos2000@gmail.com>, 2014 +# Dimitris Spentzos <jimspentzos2000@gmail.com>, 2014 # Jim Spentzos, 2014 -# Δημήτρης Σπέντζος <jimspentzos2000@gmail.com>, 2014 -# Δημήτρης Σπέντζος <jimspentzos2000@gmail.com>, 2014 -# Δημήτρης Σπέντζος <jimspentzos2000@gmail.com>, 2014 +# Dimitris Spentzos <jimspentzos2000@gmail.com>, 2014 +# Dimitris Spentzos <jimspentzos2000@gmail.com>, 2014 +# Dimitris Spentzos <jimspentzos2000@gmail.com>, 2014 msgid "" msgstr "" "Project-Id-Version: Mageia\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-10-30 12:08+0100\n" -"PO-Revision-Date: 2020-10-30 11:19+0000\n" -"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" +"PO-Revision-Date: 2020-12-21 05:27+0000\n" +"Last-Translator: Dimitrios Glentadakis <dglent@free.fr>\n" "Language-Team: Greek (http://www.transifex.com/MageiaLinux/mageia/language/" "el/)\n" "Language: el\n" @@ -92,19 +92,19 @@ msgstr "Η μόνιμη κατάτμηση δημιουργήθηκε" #: backend/raw_write.py:281 msgid "formatting partition" -msgstr "" +msgstr "μορφοποίηση κατάτμησης" #: backend/raw_write.py:329 msgid "opening encrypted partition" -msgstr "" +msgstr "άνοιγμα κρυπτογραφημένης κατάτμησης" #: backend/raw_write.py:352 msgid "formatting encrypted partition" -msgstr "" +msgstr "μορφοποίηση κρυπτογραφημένης κατάτμησης" #: backend/raw_write.py:374 msgid "closing encrypted partition" -msgstr "" +msgstr "κλείσιμο κρυπτογραφημένης κατάτμησης" #: lib/isodumper.py:208 msgid "Target Device: " @@ -161,7 +161,7 @@ msgstr "Γράφτηκε: {}%" #: lib/isodumper.py:279 lib/isodumper.py:375 lib/isodumper.py:437 msgid "unmounting" -msgstr "" +msgstr "αποπροσάρτηση" #: lib/isodumper.py:307 msgid "Backup confirmation" |