[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: menu handling by cdd-common



On Sat, 17 Apr 2004, Cosimo Alfarano wrote:

> - any registered user has in its home a script named ~/.menu/cdd-menu
>   executed by update-menu when run as users (not root).
>   It looks for CDDs and ROLEs user belongs to, and prints out them (as
>   requested by current menu system)
Great.  When I was offline for 10 ours I wrote my own version of
it. ;-)  I'll try to merge something and learn from your more
elegant stuff... :)

> In this way no files in ${HOME} are touched except for this script.
While I wrote the script I wondered how to replace ${HOME}/.menu/cdd-menu
if necessary?
Is a "Do not touch this file" comment enough to override the file blindly?
A backup of this does not suffice because remaining failes in .menu coud
causes trouble.

> A user interevention is needed, but it can be done by a script in
> /etc/X11/Xsession.d/ running cdd-update-menus (a wrapper around
> update-menus), I suppose.
I'm busy to port debian-med packages to the new stuff and found out that
lintian throwas a warning if you include cdd-update-menus in post{inst,rm}
scripts.  This is for sure a lintian bug which can be fixed by

--- menus.orig  2004-04-17 11:08:55.000000000 +0200
+++ menus       2004-04-17 11:08:26.000000000 +0200
@@ -279,7 +279,7 @@
        }

        # does the script call update-menus?
-       if (/update-menus/ && !/--no-update-menus/) {
+       if (/\supdate-menus\s/ && !/--no-update-menus/) {
            # yes, it does.
            $pres->{'calls-updatemenus'} = 1;

but there are several ways how to handle this:

    1. Fix linitan  (should be done in any case)
    2. rename script (I wouldn't like that because the name is fine)
    3. Try to call script in lintian compliant way:
         if [ -x /usr/bin/update-menus ] ; then update-menus ; fi
       (should be done if you think 4. is not good)
    4. Let CDD packages depend from menu in general
       (an alternative to 3.)

> I'm waiting for your comments :)
I'm really happy about the fine cooperation!

Moreover I found out that there is some nasty bug in update-menus
which is not connected to CDD but could be really boring:

~> update-menus
Unknown error, message=replacewith($string, $replace, $with): $replace and $with must have the same length.
install-menu: /etc/menu-methods/freedesktop-desktop-entry-spec-dirs: aborting
update-menus[9947]: Script /etc/menu-methods/freedesktop-desktop-entry-spec-dirs returned error status 1.
Unknown error, message=replacewith($string, $replace, $with): $replace and $with must have the same length.
install-menu: /etc/menu-methods/freedesktop-desktop-entry-spec-apps: aborting
update-menus[9947]: Script /etc/menu-methods/freedesktop-desktop-entry-spec-apps returned error status 1.

This also brings up the question, whether our stuff works with KDE ...

Any educated KDE people around?

Kind regards

          Andreas.



Reply to: