[Slackbuilds-users] Admins - Question about Brave browser
B. Watson
urchlay at slackware.uk
Fri Apr 15 21:54:56 UTC 2022
On Fri, 15 Apr 2022, Andrew Payne wrote:
> This slackbuild will adjust MIME settings for Brave. If you
> wish to retain your current MIME settings, you can remove:
>
> if [ -x /usr/bin/update-mime-database ]; then
> /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
> fi
>
> from the doinst.sh file before building.
>
> ++
>
> OR pull the MIME lines out of doinst.sh altogether.
You should remove the update-mime-database lines from the doinst.sh,
since they don't do anything anyway, other than waste a bit of time.
update-mime-database doesn't do what you thought it did...
Explanation distilled from 'man update-mime-database' and the
freedesktop shared mime-info specification:
https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.21.html
Basically, the mime database in /usr/share/mime defines MIME types
like image/png or text/plain. It doesn't have anything to do with user
preferences (your doinst.sh won't make Brave the default browser)...
update-mime-database just reads the XML files in /usr/share/mime
and creates a /usr/share/mime/mime.cache file that's faster for
applications to use than it would be if they had to parse the XML
files every time.
Looking at the brave-browser package, there's nothing in
$PKG/usr/share/mime anyway, so update-mime-database won't actually
change anything when it runs. It will look at the XML files in
/usr/share/mime, and create a new /usr/share/mime/mime.cache... which
will be identical to the old one because no XML files get added,
deleted, or modified when you install the package.
Try this, on a system without brave-browser installed:
# rm -rf /usr/share/mime/mime.cache # yes, it's OK to do this
# update-mime-database /usr/share/mime
# md5sum /usr/share/mime/mime.cache
...install your brave-browser package, with the update-mime-database
lines in the doinst.sh, then:
# md5sum /usr/share/mime/mime.cache
The md5sum should be identical to what it was before you installed the
package. Meaning, installing the package didn't modify the cache.
More information about the SlackBuilds-users
mailing list