Bug 99297 - Add x-systemd-unit MIME type
Summary: Add x-systemd-unit MIME type
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Shared Mime Info group
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-06 10:23 UTC by Philip Withnall
Modified: 2017-01-09 11:15 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Add x-systemd-unit MIME type (8.20 KB, patch)
2017-01-06 10:23 UTC, Philip Withnall
Details | Splinter Review
Add x-systemd-unit and x-dbus-service MIME types (10.32 KB, patch)
2017-01-09 09:13 UTC, Philip Withnall
Details | Splinter Review

Description Philip Withnall 2017-01-06 10:23:46 UTC
Patch attached, including tests.

See https://bugzilla.gnome.org/show_bug.cgi?id=776319 for the rationale.
Comment 1 Philip Withnall 2017-01-06 10:23:54 UTC
Created attachment 128791 [details] [review]
Add x-systemd-unit MIME type

This covers all types of systemd unit file, matching by filename and
magic string.
Comment 2 Lennart Poettering 2017-01-06 10:32:38 UTC
Looks good to me. But this could be tightened a bit I think. The section name must be followed by a newline, and must be following either a newline or the beginning of the file. Can the mime spec language express something like that?
Comment 3 Bastien Nocera 2017-01-06 10:39:35 UTC
Test doesn't pass:
0 errors, 1164 comparisons, 189 failed (189 expected), 1 unexpected successes

You should also add a D-Bus .service mime-type and test, as mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=776319#c4
Comment 4 Philip Withnall 2017-01-09 09:13:35 UTC
Created attachment 128822 [details] [review]
Add x-systemd-unit and x-dbus-service MIME types

These cover all types of systemd unit file, and D-Bus services, matching
by filename and magic string.

They are added together as both use the .service extension, and hence
can be confused if only matched by name. Matching by content sniffing
disambiguates them, as they use different group headers.
Comment 5 Bastien Nocera 2017-01-09 11:15:04 UTC
Attachment 128822 [details] pushed as 46adfc5 - Add x-systemd-unit and x-dbus-service MIME types


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.