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

Re: menuentry format (change?) (Was: Bug#15182)



In an attempt to save the world from disaster, Joey Hess wrote:
> joost witteveen wrote:
> > On the other hand, I could also do some extra work, and say that
> > the old/new syntax are not allowed to be mixed in one menuentry file
> > (not very likely anyway). My preference then would be to make an
> > empty line a seperator between the menuentries, as in
> 
> Is that backwards compatable to the current syntax?

More or less. 

No, it certainly isn't backwards compatible and if you give that
newline-style menuentry syntax to menu-1.5-11, it will not understand it.

But I do think I can make menu-1.6 check for whether a file is
"new syntax" or "new syntax + empty seperators" with
an algorithm like

  - if the first char of a file is not "?", it's "old syntax".
  - else, if there occurences of "[^\\]\n[^?]", (a newline that has both
    before it not a "\" char, and after it not a "?" char),
    it's "new syntax + empty-line-seperator"
  - else it's "currently new syntax"

So, although I'm not confident the above algorithm catches all cases,
I am confident I can make something that caches (at least nearly) all cases.
If there are a few cases left I don't catch, I can always ask the maintainer
of those menuentryfiles to start using the "new syntax + emptyline" 
menuentries.


>  
> > ?package(mypackage):tag1=hello
> > tag2="my
> > 
> > dear"
> > tag3="or world"
> > 
> > ?package(mypackage):tag1=and_so_on
> > tag2="It's getting boring"
> > tag3="It must be clear now"
> > 
> > ?package(mypackage):tag1="this is it"
> > 
> > I don't like to make the "?package(" string a seperator for the menuentries
> > for two reasons:
> > 
> >   - it's rather counter-intuative. At least I cannot think of anything
> >     similar anywhere else -- usually the end of a section is denoted
> >     by eighter a newline (sh), a ";" (C, pascal, whatever).
> >     Or you have grouped things like "{}", "begin/end", "<a> / </a>"
> > 
> >   - I would like to be able to extend the current syntax to things like
> > 
> >       ? package(mypacage) && package(herpackage): ....
> > 
> >       ? !package(hispackage): ...
> > 
> >       ? file("/usr/bin/bash"): ...
> > 
> >       ? time() > 946684800 : command="echo welcome to the next milleneum" ...
> > 
> >     i.e., between the "?" and the ":" a simple test for update-menus, whether
> >     or not to include the concerning menuentry. This would not be possible
> >     if "?package(" would be the string to start a new menuentry.
> > 
> >    
> > -- 
> > joost witteveen, joostje@debian.org
> > 
> > The upstream maintainer is allowed to do things different 
> > than Debian, but only if he has good reasons to do so.
> 
> -- 
> see shy jo
> 


-- 
joost witteveen, joostje@debian.org

The upstream maintainer is allowed to do things different 
than Debian, but only if he has good reasons to do so.


--
E-mail the word "unsubscribe" to debian-devel-request@lists.debian.org
TO UNSUBSCRIBE FROM THIS MAILING LIST. Trouble? E-mail to listmaster@lists.debian.org


Reply to: