# HG changeset patch # User brett # Date 1202344706 18000 # Node ID 7a0aafe2fe87729a4e6bd0d1a53d422f87dd365f # Parent 16506464d57ba312e5cbacbbc0c2c85afeec9ddf [svn] Find self-extracting archives by their file magic only, not extension/mimetype. The problem with using extensions/mimetypes for this is that it net way too many false positives. Files ending in .com, .bat, etc. would cause the user to be prompted for recursive extraction. This makes that problem go away, and it means that error messages when the user tries to extract a non-archive .exe will probably be more useful, too. diff -r 16506464d57b -r 7a0aafe2fe87 scripts/dtrx --- a/scripts/dtrx Sun Jan 20 15:32:02 2008 -0500 +++ b/scripts/dtrx Wed Feb 06 19:38:26 2008 -0500 @@ -694,7 +694,7 @@ mimetype_map = {} for mapping in (('tar', 'x-tar'), - ('zip', 'x-msdos-program', 'zip'), + ('zip', 'zip'), ('deb', 'x-debian-package'), ('rpm', 'x-redhat-package-manager', 'x-rpm'), ('cpio', 'x-cpio'), @@ -710,7 +710,7 @@ for mapping in (('deb', 'Debian binary package'), ('cpio', 'cpio archive'), ('tar', 'POSIX tar archive'), - ('zip', 'Zip archive'), + ('zip', '(Zip|ZIP self-extracting) archive'), ('rpm', 'RPM'), ('7z', '7-zip archive'), ('cab', 'Microsoft Cabinet archive')): @@ -727,7 +727,7 @@ for mapping in (('tar', 'bzip2', 'tar.bz2'), ('tar', 'gzip', 'tar.gz', 'tgz'), ('tar', None, 'tar'), - ('zip', None, 'zip', 'exe'), + ('zip', None, 'zip'), ('deb', None, 'deb'), ('rpm', None, 'rpm'), ('cpio', None, 'cpio'),