Does not inform the user when files where lost while cleaning an archive
I've just run MAT on a tarball (
.tar.bz2) that contained a few dozens
.pm Perl program files, plus a PDF, 2 JPG's and a
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.
#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
#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?