Project

General

Profile

Bug #6416

Does not inform the user when files where lost while cleaning an archive

Added by intrigeri about 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
11/11/2013
Due date:
% Done:

100%

QA Check:
Feature Branch:
Starter:

Description

I've just run MAT on a tarball (.tar.bz2) that contained a few dozens .pl and .pm Perl program files, plus a PDF, 2 JPG's and a .txt.

MAT happily tells me "whatever.tar.bz2 cleaned !" (the space before the exclamation mark is a typo, btw).

I would appreciate it if it quickly mentioned, in passing, that most of the files were removed from the tarball, that now only contains the non-Perl files.


Related issues

Related to MAT - Bug #7012: GUI fails to clean archive that contains unsupported files, after forcefully including some of these Confirmed 04/03/2014

History

#1 Updated by jvoisin almost 6 years ago

  • Status changed from New to 11

#2 Updated by jvoisin almost 6 years ago

  • Status changed from 11 to Resolved

#3 Updated by intrigeri almost 6 years ago

  • Status changed from Resolved to In Progress

I can reproduce this bug with MAT 0.5.1 (including the typo ;), so I'm reopening this ticket. This is with the MAT CLI, for what it's worth.

#4 Updated by jvoisin almost 6 years ago

  • Status changed from In Progress to 11

Commit #36c963e address this.

#5 Updated by intrigeri almost 6 years ago

Also, it seems that some issue was introduced there:

$ ./mat  --add2archive /tmp/src.tar.bz2
[*] Cleaning /tmp/src.tar.bz2
/usr/lib/python2.7/tarfile.py:1968: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal

I suggest reopening this ticket until these minor problems are
all fixed.

#6 Updated by intrigeri almost 6 years ago

Commit #36c963e address this.

Cool. The following patch fixes a typo (missing space), and tells the
user what they can do in this case:

--- a/mat
+++ b/mat
@@ -93,10 +93,12 @@ def clean_meta(class_file, filename, add2archive):
         if is_archive and not is_terminal:
             unsupported_list = class_file.list_unsupported()
             if type(unsupported_list) == list and unsupported_list:
-                print('[-] Can not clean: %s.'\
+                print('[-] Can not clean: %s. '\
                 'It contains unsupported filetypes:' % filename)
                 for i in unsupported_list:
                     print('- %s' % i)
+                print('To force including these files in the resulting archive, '\
+                      'use the --add2archive option.')
                 return 1
     if class_file.remove_all():
         print('[+] %s cleaned !' % filename)

Mind to apply it?

#7 Updated by intrigeri almost 6 years ago

  • Status changed from 11 to In Progress
  • % Done changed from 0 to 80

#8 Updated by jvoisin almost 6 years ago

I don't like this patch, since using --add2archive would add unknowns files to all archives, and not only one. I think the help message needs to be rephrased.

#9 Updated by jvoisin over 5 years ago

  • Status changed from In Progress to 11

#10 Updated by intrigeri over 5 years ago

  • Status changed from 11 to Resolved
  • % Done changed from 80 to 100

I confirm it's fixed in 0.5.2. Thanks!

#11 Updated by intrigeri over 5 years ago

  • Related to Bug #7012: GUI fails to clean archive that contains unsupported files, after forcefully including some of these added

Also available in: Atom PDF