From: Koen Kooi <k.kooi@student.utwente.nl>
To: openembedded-devel@openembedded.org
Subject: Re: broken shared-mime-info and MIME typing
Date: Thu, 04 Dec 2008 16:45:29 +0100 [thread overview]
Message-ID: <gh8tup$11g$1@ger.gmane.org> (raw)
In-Reply-To: <1228404803.14968.296.camel@hammer.suse.cz>
On 04-12-08 16:33, Stanislav Brabec wrote:
> Koen Kooi wrote:
>
>>> This would not work. Without freedesktop.org.xml the command
>>> "update-mime-database /usr/share/mime" will ruin the database.
>> That does work, had you looked a bit better:
>>
>> mime.bbclass does:
>> rdepends.append("freedesktop-mime-info")
>
> My mistake, NOTE says different. But problem 1 is still valid for manual
> calling of "update-mime-database /usr/share/mime" on a system, that does
> not have freedesktop-mime-info.
>
> 2., 3. and 4. were just a suggestions, 5. is a minor issue.
>
> See attached patch (untested), which should do 2., 3. and 4.
> Issue 5 fix is not done yet.
>
>> I tested it on 2 devices and it does the right thing:
>> freedesktop.org.xml gets installed before the update-mime-database
>> command is run.
>
> Yes, it works for packages. Actually users of locales will get
> freedesktop-mime-info automatically due to 5.
>
> diff --git a/classes/mime.bbclass b/classes/mime.bbclass
> index a214c11..75c1db9 100644
> --- a/classes/mime.bbclass
> +++ b/classes/mime.bbclass
> @@ -5,9 +5,6 @@ if [ "$1" = configure ]; then
> if [ -x ${bindir}/update-mime-database ] ; then
> echo "Updating MIME database... this may take a while."
> update-mime-database $D${datadir}/mime
> - else
> - echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
> - exit 1
> fi
> fi
> }
> @@ -17,9 +14,6 @@ if [ "$1" = remove ] || [ "$1" = upgrade ]; then
> if [ -x ${bindir}/update-mime-database ] ; then
> echo "Updating MIME database... this may take a while."
> update-mime-database $D${datadir}/mime
> - else
> - echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
> - exit 1
> fi
> fi
> }
You want it to error out of u-m-d is not found, since the purpose of the
postinst (updating the database) couldn't be done. Do you have a
use-case for this non-error behaviour?
> @@ -50,7 +44,9 @@ python populate_packages_append () {
> postrm += bb.data.getVar('mime_postrm', d, 1)
> bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
> bb.note("adding shared-mime-info dependency to %s" % pkg)
> - rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
> - rdepends.append("freedesktop-mime-info")
> - bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
> + rrecommends = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 0) or bb.data.getVar('RRECOMMENDS', d, 0) or "")
> + rrecommends.append("freedesktop-mime-info")
> + bb.data.setVar('RRECOMMENDS_' + pkg, " " + " ".join(rrecommends), d)
I'm not sure what the above accomplished, apart from making it easier to
shoot yourself in the foot. What's the usecase for allowing to install
the xml files, but not the update tool (assuming you applied the changes
below)?
> +FILES_${PN} += "${datadir}/mime/packages"
I'm not so sure on that one, but I guess recipes can put the package
theu want the xml file in before ${PN} in PACKAGES
> diff --git a/packages/shared-mime-info/shared-mime-info_0.51.bb b/packages/shared-mime-info/shared-mime-info_0.51.bb
> index 31a7df1..cb1f329 100644
> --- a/packages/shared-mime-info/shared-mime-info_0.51.bb
> +++ b/packages/shared-mime-info/shared-mime-info_0.51.bb
> @@ -10,6 +10,6 @@ do_install_append() {
> # freedesktop.org.xml is huge and only needed when updating the db
> # mime.bbclass will add the dependency on it automagically
> PACKAGES =+ "freedesktop-mime-info"
> -FILES_freedesktop-mime-info = "${datadir}/mime/packages/freedesktop.org.xml"
> +FILES_freedesktop-mime-info = "${datadir}/mime/packages/freedesktop.org.xml ${bindir}/update-mime-database"
> RDEPENDS_freedesktop-mime-info = "shared-mime-info"
If you're going to package those together you should name the package
'update-mime-database' to avoid confusion when people want to install
the utils and do 'opkg list | grep mime'.
regards,
Koen
next prev parent reply other threads:[~2008-12-04 15:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-04 9:51 broken shared-mime-info and MIME typing Stanislav Brabec
2008-12-04 11:18 ` Koen Kooi
2008-12-04 11:54 ` Koen Kooi
2008-12-04 13:09 ` Stanislav Brabec
2008-12-04 13:28 ` Koen Kooi
2008-12-04 15:33 ` Stanislav Brabec
2008-12-04 15:45 ` Koen Kooi [this message]
2008-12-04 17:18 ` Stanislav Brabec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='gh8tup$11g$1@ger.gmane.org' \
--to=k.kooi@student.utwente.nl \
--cc=openembedded-devel@lists.openembedded.org \
--cc=openembedded-devel@openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.