Discussion:
mimetypes: adding mimetype for scons scripts
Carnë Draug
2015-01-20 17:58:53 UTC
Permalink
Hi

scons [1] is a build system and I was thinking of adding it to
shared-mime-info. Its files are very simple to identify, they are
always named SConstruct or SConscript. These files are also valid
python scripts.

Should shared-mime-info identify them (I can submit a git patch, no
problem) or should SCons itself add a rule when they are installed?
I am guessing that a SCons mimetype would be "text/x-scons" is that
correct? Or should they be identified only as python scripts?

I saw there are rules for make and cmake so I thought that adding
to shared-mime-info would be the way to go.

Thank you
Carnë

[1] http://www.scons.org/
Jerome Leclanche
2015-01-20 18:32:56 UTC
Permalink
Post by Carnë Draug
Hi
scons [1] is a build system and I was thinking of adding it to
shared-mime-info. Its files are very simple to identify, they are
always named SConstruct or SConscript. These files are also valid
python scripts.
Should shared-mime-info identify them (I can submit a git patch, no
problem) or should SCons itself add a rule when they are installed?
I am guessing that a SCons mimetype would be "text/x-scons" is that
correct? Or should they be identified only as python scripts?
I saw there are rules for make and cmake so I thought that adding
to shared-mime-info would be the way to go.
Thank you
Carnë
[1] http://www.scons.org/
_______________________________________________
xdg mailing list
http://lists.freedesktop.org/mailman/listinfo/xdg
If a text/x-scons mime type is defined and accepted by the SCons devs,
it would then be a sub-type of text/x-python.
J. Leclanche
Carnë Draug
2015-01-21 13:08:11 UTC
Permalink
Post by Carnë Draug
scons [1] is a build system and I was thinking of adding it to
shared-mime-info. Its files are very simple to identify, they are
always named SConstruct or SConscript. These files are also valid
python scripts.
Should shared-mime-info identify them (I can submit a git patch, no
problem) or should SCons itself add a rule when they are installed?
I am guessing that a SCons mimetype would be "text/x-scons" is that
correct? Or should they be identified only as python scripts?
I saw there are rules for make and cmake so I thought that adding
to shared-mime-info would be the way to go.
Hello Carnė,
if you would like to assign a media type for SCons files, please also consider
to register it to the IANA. It is a lightweigt procedure and registration of
new types is welcome.
http://www.iana.org/assignments/media-types/media-types.xhtml
I took a look at the list of existing mimes and I could not find one for
Makefile, perl, or python. Would a mimetype for SCons be relevant when it
does not even exist one for those much more common files?

Carnë
Carnë Draug
2015-01-21 13:28:22 UTC
Permalink
...
Post by Carnë Draug
scons [1] is a build system and I was thinking of adding it to
shared-mime-info. Its files are very simple to identify, they are
always named SConstruct or SConscript. These files are also valid
python scripts.
Should shared-mime-info identify them (I can submit a git patch, no
problem)
This seems like an easy thing to add, with some possible upside and no
downside. So why not, I say. Carnë, I think it would be better for you to
add it to shared-mime-info; SCons could do it but (a) it would be more
complex, and (b) it wouldn't identify SConstructs when SCons isn't
installed.
Yes. shared-mime-info seems to agree with, they only need acceptance from
If a text/x-scons mime type is defined and accepted by the SCons devs,
it would then be a sub-type of text/x-python.
J. Leclanche
So unless someone opposes I will submit a patch to shared-mime-info.
Regarding
[...]
SConstruct is a required name, but SConscript is not even though it may be
the standard/convention. The subscripts can use any name you like
technically. I usually include the "*.py" extension so that language
bindings in editors work without setting changes.
what if the magic uses the following globs for filenames "SConstruct",
"SConscript", and "SConscript.*" ?

Carnë
Carnë Draug
2015-01-21 18:02:10 UTC
Permalink
Post by Carnë Draug
...
Post by Carnë Draug
scons [1] is a build system and I was thinking of adding it to
shared-mime-info. Its files are very simple to identify, they are
always named SConstruct or SConscript. These files are also valid
python scripts.
Should shared-mime-info identify them (I can submit a git patch, no
problem)
This seems like an easy thing to add, with some possible upside and no
downside. So why not, I say. Carnë, I think it would be better for you to
add it to shared-mime-info; SCons could do it but (a) it would be more
complex, and (b) it wouldn't identify SConstructs when SCons isn't
installed.
Yes. shared-mime-info seems to agree with, they only need acceptance from
If a text/x-scons mime type is defined and accepted by the SCons devs,
it would then be a sub-type of text/x-python.
J. Leclanche
So unless someone opposes I will submit a patch to shared-mime-info.
Regarding
[...]
SConstruct is a required name, but SConscript is not even though it may be
the standard/convention. The subscripts can use any name you like
technically. I usually include the "*.py" extension so that language
bindings in editors work without setting changes.
what if the magic uses the following globs for filenames "SConstruct",
"SConscript", and "SConscript.*" ?
I have just added a patch for this to bug #87920 [1]. Could someone
review it please?

I also add 3 new tests based on SCons configuration which I found on the
repositories for MongoDB, Battle for Wesnoth, and SCons itself.

Carnë

[1] https://bugs.freedesktop.org/show_bug.cgi?id=87920
Carnë Draug
2015-01-23 17:02:01 UTC
Permalink
Post by Carnë Draug
Post by Carnë Draug
...
Post by Carnë Draug
scons [1] is a build system and I was thinking of adding it to
shared-mime-info. Its files are very simple to identify, they are
always named SConstruct or SConscript. These files are also valid
python scripts.
Should shared-mime-info identify them (I can submit a git patch, no
problem)
This seems like an easy thing to add, with some possible upside and no
downside. So why not, I say. Carnë, I think it would be better for you to
add it to shared-mime-info; SCons could do it but (a) it would be more
complex, and (b) it wouldn't identify SConstructs when SCons isn't
installed.
Yes. shared-mime-info seems to agree with, they only need acceptance from
If a text/x-scons mime type is defined and accepted by the SCons devs,
it would then be a sub-type of text/x-python.
J. Leclanche
So unless someone opposes I will submit a patch to shared-mime-info.
Regarding
[...]
SConstruct is a required name, but SConscript is not even though it may be
the standard/convention. The subscripts can use any name you like
technically. I usually include the "*.py" extension so that language
bindings in editors work without setting changes.
what if the magic uses the following globs for filenames "SConstruct",
"SConscript", and "SConscript.*" ?
I have just added a patch for this to bug #87920 [1]. Could someone
review it please?
I also add 3 new tests based on SCons configuration which I found on the
repositories for MongoDB, Battle for Wesnoth, and SCons itself.
Carnë
I looked at your patch. Looks good. Only thought I had was you could
probably have much more trivial files as the test files.
I thought the same at start but then it occurred me that real, more
complex cases
are better for testing purposes. The simplest case may be good for test suite
of a library but not for identification of a file mimetype. 'Program
("hello.c")'
would be a valid SConstruct file but a complex fle with a lot of python makes it
ambiguous and more likely to be confused with x-python.

Could anyone from shared-mime-info comment or accept my commit? [1]

Carnë

[1] https://bugs.freedesktop.org/show_bug.cgi?id=87920#c1
Carnë Draug
2015-01-28 12:14:09 UTC
Permalink
Post by Carnë Draug
Post by Carnë Draug
Post by Carnë Draug
...
Post by Carnë Draug
scons [1] is a build system and I was thinking of adding it to
shared-mime-info. Its files are very simple to identify, they are
always named SConstruct or SConscript. These files are also valid
python scripts.
Should shared-mime-info identify them (I can submit a git patch, no
problem)
This seems like an easy thing to add, with some possible upside and no
downside. So why not, I say. Carnë, I think it would be better for you to
add it to shared-mime-info; SCons could do it but (a) it would be more
complex, and (b) it wouldn't identify SConstructs when SCons isn't
installed.
Yes. shared-mime-info seems to agree with, they only need acceptance from
If a text/x-scons mime type is defined and accepted by the SCons devs,
it would then be a sub-type of text/x-python.
J. Leclanche
So unless someone opposes I will submit a patch to shared-mime-info.
Regarding
[...]
SConstruct is a required name, but SConscript is not even though it may be
the standard/convention. The subscripts can use any name you like
technically. I usually include the "*.py" extension so that language
bindings in editors work without setting changes.
what if the magic uses the following globs for filenames "SConstruct",
"SConscript", and "SConscript.*" ?
I have just added a patch for this to bug #87920 [1]. Could someone
review it please?
I also add 3 new tests based on SCons configuration which I found on the
repositories for MongoDB, Battle for Wesnoth, and SCons itself.
Carnë
I looked at your patch. Looks good. Only thought I had was you could
probably have much more trivial files as the test files.
I thought the same at start but then it occurred me that real, more
complex cases
are better for testing purposes. The simplest case may be good for test suite
of a library but not for identification of a file mimetype. 'Program
("hello.c")'
would be a valid SConstruct file but a complex fle with a lot of python makes it
ambiguous and more likely to be confused with x-python.
Could anyone from shared-mime-info comment or accept my commit? [1]
Carnë
[1] https://bugs.freedesktop.org/show_bug.cgi?id=87920#c1
For anyone interested, this has now been accepted into shared-mime-info [1].

Carnë

[1] http://cgit.freedesktop.org/xdg/shared-mime-info/commit/?id=29c2eab964cfd8c45fd8a7f5d8407bbc94222095
Loading...