Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 919245 - MIME type confusion: (at least) dev-vcs/subversion-1.14.2-r1 defaults to binary for ebuilds etc
Summary: MIME type confusion: (at least) dev-vcs/subversion-1.14.2-r1 defaults to bina...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andreas K. Hüttel
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-05 07:46 UTC by Joe Breuer
Modified: 2024-02-08 03:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Breuer 2023-12-05 07:46:01 UTC
I have a local overlay repo that's (still... nothing stays around longer than a temporary fix) version controlled using subversion.

When I added a new ebuild today, I noticed that subversion defaults to treating (at least) ebuilds and Manifests as binary files (which in turn, as I understand it, makes diff/patch not work as expected etc.)

I traced this to subversion identifying those files with MIME types of application/vnd.gentoo.ebuild and application/vnd.gentoo.manifest, respectively.

Manually setting the MIME type is a workaround:
 $ svn propset svn:mime-type text/plain *.ebuild Manifest

I guess some system wide MIME configuration system has been upgraded to a point where it identifies the gentoo specific files with the above-mentioned MIME types.
I can't help but wonder whether application/... is a good category for those, since those files are, in fact, text-based - why is it not text/...manifest and text/...ebuild? (What are the MIME type conventions for source code etc. like, anyway...?)

Does subversion simply look at the category (application/... vs text/...), or is there more going on? Does it have a compiled-in list of MIME types that should NOT be treated as binary, that could be patched?

Anyway, lest I forget, I'm writing this up straight away.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-08 03:02:52 UTC
(In reply to Joe Breuer from comment #0)
> I have a local overlay repo that's (still... nothing stays around longer
> than a temporary fix) version controlled using subversion.
> 
> When I added a new ebuild today, I noticed that subversion defaults to
> treating (at least) ebuilds and Manifests as binary files (which in turn, as
> I understand it, makes diff/patch not work as expected etc.)
> 
> I traced this to subversion identifying those files with MIME types of
> application/vnd.gentoo.ebuild and application/vnd.gentoo.manifest,
> respectively.

They're actually officially registered! :)

https://marc.info/?l=gentoo-dev&m=166245650202553&w=2

(They've since been ratified or whatever.)

> 
> Manually setting the MIME type is a workaround:
>  $ svn propset svn:mime-type text/plain *.ebuild Manifest
> 
> I guess some system wide MIME configuration system has been upgraded to a
> point where it identifies the gentoo specific files with the above-mentioned
> MIME types.
> I can't help but wonder whether application/... is a good category for
> those, since those files are, in fact, text-based - why is it not
> text/...manifest and text/...ebuild? (What are the MIME type conventions for
> source code etc. like, anyway...?)

This is either beyond me, or I've forgotten, but IIRC application/ is right for it.

> 
> Does subversion simply look at the category (application/... vs text/...),
> or is there more going on? Does it have a compiled-in list of MIME types
> that should NOT be treated as binary, that could be patched?
> 

Maybe we're triggering something around here https://github.com/apache/subversion/blob/256922fa2eeda6bfb4354a32933da57baf0afeff/subversion/libsvn_subr/magic.c#L143?