unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Trent W. Buck" <trentbuck@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Michael Albinus <michael.albinus@gmx.de>,
	52477@debbugs.gnu.org, stefan@marxist.se
Subject: bug#52477: 27.1; .crx and .crx3 are zip files
Date: Wed, 22 Dec 2021 14:50:43 +1100	[thread overview]
Message-ID: <YcKgkyRAwVG70P61@hera.lan> (raw)
In-Reply-To: <83fsqshehh.fsf@gnu.org>

Eli Zaretskii wrote:
> > From: Michael Albinus <michael.albinus@gmx.de>
> > Cc: stefan@marxist.se,  trentbuck@gmail.com,  52477@debbugs.gnu.org
> > Date: Thu, 16 Dec 2021 12:59:01 +0100
> > 
> > > If the file doesn't follow the PKZip spec in the initial signature,
> > > who knows what else in that spec doesn't it follow?  The ZIP spec has
> > > a lot of special rules and formatting requirements, so if a file
> > > doesn't follow them, how can we support it without knowing its exact
> > > format specification?
> > 
> > ".crx" files are Chrome Extensions, as shown by Stefan. They are
> > specified, see for example <https://developer.chrome.com/docs/extensions/reference/>.
> > 
> > Personally, I have no strong opinion whether we shall support them.
> 
> Me neither, but if someone wants to extend arc-mode.el to support
> those extension, that would be welcome, I think.  My point is that we
> cannot just add this file type before we implement those extensions.

FTR, as the end user, I don't really care HOW it's implemented.

I also don't really care about editing, i.e. read-only support is fine.
I have a similar "eyeball the result" workflow for .deb using

    /usr/share/emacs/site-lisp/elpa-src/debian-el-37/deb-view.el

Another case of "it's a zip, but" is the .pyz, which
has an (optional) shebang before the PK:

    bash5$ mkdir MyCoolApp
    bash5$ touch MyCoolApp/__init__.py
    bash5$ echo 'print("Hello, World!")' >MyCoolApp/__main__.py
    bash5$ python3 -m zipapp --compress --python=/usr/bin/python3 MyCoolApp
    bash5$ ./MyCoolApp.pyz
    Hello, World!
    bash5$ head -n1 MyCoolApp.pyz
    #!/usr/bin/python3
    bash5$ file MyCoolApp.pyz
    MyCoolApp.pyz: Zip archive data, made by v2.0 UNIX, extract using at least v2.0, last modified Tue Jun 10 02:57:41 2014, uncompressed size 23, method=deflate

    bash5$ emacs MyCoolApp.pyz
    <Emacs does not understand it>

Someone mentioned libarchive, originally from BSD, which provides a
standard interface to EVERY(ish) archive and compression format.

Is it reasonable for emacs to just chuck out arc-mode (and tar-mode
and jka-compr) and instead just use libarchive?
It's already used by vlc and a lot of GNOME stuff.

libarchive already understands both .pyz and .crx3 files, at least for reading:

    bash5$ bsdtar -vtf MyCoolApp.pyz
    -rw-r--r--  0 0      0          23 Dec 22 14:33 __main__.py
    -rw-r--r--  0 0      0           0 Dec 22 14:33 __init__.py

    bash5$ bsdtar -vtf jamhcnnkihinmdlkakkaopbjbbcngflc_99.0.4764.2_all_nfh7crk5nxg3omjxfwx5cuhrz4.crx3
    -rw-rw-r--  0 0      0        3484 Dec 13 12:34 hyph-und-ethi.hyb
    -rw-rw-r--  0 0      0        2712 Dec 13 12:34 hyph-tk.hyb
    -rw-rw-r--  0 0      0         703 Dec 13 12:34 hyph-te.hyb
    -rw-rw-r--  0 0      0         554 Dec 13 12:34 hyph-ta.hyb
    -rw-rw-r--  0 0      0        6631 Dec 13 12:34 hyph-sl.hyb
    -rw-rw-r--  0 0      0        1414 Dec 13 12:34 hyph-pt.hyb
    -rw-rw-r--  0 0      0         607 Dec 13 12:34 hyph-pa.hyb
    -rw-rw-r--  0 0      0         647 Dec 13 12:34 hyph-or.hyb
    -rw-rw-r--  0 0      0      145263 Dec 13 12:34 hyph-nn.hyb
    -rw-rw-r--  0 0      0      145263 Dec 13 12:34 hyph-nb.hyb
    -rw-rw-r--  0 0      0         687 Dec 13 12:34 hyph-mr.hyb
    -rw-rw-r--  0 0      0        5142 Dec 13 12:34 hyph-mn-cyrl.hyb
    -rw-rw-r--  0 0      0         776 Dec 13 12:34 hyph-ml.hyb
    -rw-rw-r--  0 0      0        1839 Dec 13 12:34 hyph-la.hyb
    -rw-rw-r--  0 0      0         711 Dec 13 12:34 hyph-kn.hyb
    -rw-rw-r--  0 0      0         605 Dec 13 12:34 hyph-hy.hyb
    -rw-rw-r--  0 0      0      317251 Dec 13 12:34 hyph-hu.hyb
    -rw-rw-r--  0 0      0        3031 Dec 13 12:34 hyph-hr.hyb
    -rw-rw-r--  0 0      0         687 Dec 13 12:34 hyph-hi.hyb
    -rw-rw-r--  0 0      0         655 Dec 13 12:34 hyph-gu.hyb
    -rw-rw-r--  0 0      0       35824 Dec 13 12:34 hyph-ga.hyb
    -rw-rw-r--  0 0      0        8165 Dec 13 12:34 hyph-fr.hyb
    -rw-rw-r--  0 0      0         665 Dec 13 12:34 hyph-eu.hyb
    -rw-rw-r--  0 0      0       21421 Dec 13 12:34 hyph-et.hyb
    -rw-rw-r--  0 0      0       14995 Dec 13 12:34 hyph-es.hyb
    -rw-rw-r--  0 0      0       59802 Dec 13 12:34 hyph-en-us.hyb
    -rw-rw-r--  0 0      0       46607 Dec 13 12:34 hyph-en-gb.hyb
    -rw-rw-r--  0 0      0      120218 Dec 13 12:34 hyph-de-ch-1901.hyb
    -rw-rw-r--  0 0      0      120412 Dec 13 12:34 hyph-de-1996.hyb
    -rw-rw-r--  0 0      0      121393 Dec 13 12:34 hyph-de-1901.hyb
    -rw-rw-r--  0 0      0        6967 Dec 13 12:34 hyph-da.hyb
    -rw-rw-r--  0 0      0       35913 Dec 13 12:34 hyph-cy.hyb
    -rw-rw-r--  0 0      0       52842 Dec 13 12:34 hyph-cu.hyb
    -rw-rw-r--  0 0      0         703 Dec 13 12:34 hyph-bn.hyb
    -rw-rw-r--  0 0      0        3467 Dec 13 12:34 hyph-bg.hyb
    -rw-rw-r--  0 0      0        6098 Dec 13 12:34 hyph-be.hyb
    -rw-rw-r--  0 0      0         703 Dec 13 12:34 hyph-as.hyb
    -rw-r--r--  0 0      0         178 Dec 13 12:34 manifest.json
    drwxrwxr-x  0 0      0           0 Dec 13 12:34 _metadata/
    -rw-rw-r--  0 0      0        5698 Dec 13 12:34 _metadata/verified_contents.json





  parent reply	other threads:[~2021-12-22  3:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14  4:56 bug#52477: 27.1; .crx and .crx3 are zip files Trent W. Buck
2021-12-15 20:51 ` Stefan Kangas
2021-12-16  8:56   ` Michael Albinus
2021-12-16  9:22     ` Eli Zaretskii
2021-12-16 11:59       ` Michael Albinus
2021-12-16 13:21         ` Eli Zaretskii
2021-12-19 13:09           ` Lars Ingebrigtsen
2021-12-22  3:50           ` Trent W. Buck [this message]
2021-12-22 12:20             ` Michael Albinus
2021-12-23  4:01               ` Trent W. Buck
2021-12-24 13:51                 ` Michael Albinus
2021-12-22 12:55             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YcKgkyRAwVG70P61@hera.lan \
    --to=trentbuck@gmail.com \
    --cc=52477@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).