xdg-mime-apps: fix regex in mimeAssociations
The XDG Desktop Entry spec mentions that multiple values per key may be optionally terminated by a semicolon. An example for this is the Firefox desktop file, which has no trailing semicolon. This breaks the sed regex used in `mimeAssociations`. Fix the regex by matching the end of string, optionally preceded by a semicolon, or any other semicolon. This makes it work with both semicolon-terminated and non-semicolon-terminated desktop files.
This commit is contained in:
parent
dbed4c794d
commit
0b7fd187e2
|
@ -94,7 +94,7 @@ in {
|
||||||
for p in $ps ; do
|
for p in $ps ; do
|
||||||
for path in "$p"/share/applications/*.desktop ; do
|
for path in "$p"/share/applications/*.desktop ; do
|
||||||
name="''${path##*/}"
|
name="''${path##*/}"
|
||||||
sed -n "/^MimeType=/ { s/.*=//; s/;/;$name\n/g; p; }" "$path"
|
sed -n -E "/^MimeType=/ { s/.*=//; s/;?$|;/;$name\n/g; p; }" "$path"
|
||||||
done
|
done
|
||||||
done > "$out"
|
done > "$out"
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue