Dependency set queries

9 views
Skip to first unread message

Bryan Bishop

unread,
Sep 29, 2009, 1:17:53 PM9/29/09
to bool...@googlegroups.com, Gustavo Narea, kan...@gmail.com
Hey all,

I emailed Gustavo earlier today but this belongs on the mailing list.

I am working on a project called skdb, which is "apt-get for real
stuff!". You don't need to read the wiki to understand this email
though-

http://adl.serveftp.org/dokuwiki/skdb

In skdb, packages have dependencies of various sorts. Unlike in debian
or gentoo, there is also this concept of a "dependency set". What this
means is that you can have X, Y, and Z, or you can have A, B, and C,
and at least one of these sets must be satisfied in order to be able
to install a package. So, it would be amazingly awesome if users can
write in their packages something like "( (X and Y) or (A and B) ) and
(G)" which should parse to a tree like:

- and:
- or:
- and:
- X
- Y
- and:
- A
- B
- G

(In other words a boolean expression tree.)

Looking at the booleano documentation, most queries look of the form:

book:title is "blah" or book:pages > 50

But in this context, I am not searching for an individual item, but
rather the existence of a particular set. Does anyone know how to do
this with booleano? Should I write my own module with pyparsing?

Thanks!

- Bryan
http://heybryan.org/
1 512 203 0507

Gustavo Narea

unread,
Nov 26, 2009, 7:19:46 PM11/26/09
to Bryan Bishop, bool...@googlegroups.com
Hello, Bryan.

First of all, I am terribly sorry for responding sooo late. I had to be away
for a few months and now I'm slowly catching up with all the pending stuff.

With Booleano you could support expressions like:
(
(depends_on("X") & depends_on("Y")
|
(depends_on("A") & depends_on("B")
&
depends_on("G")
)

(It all could be on the same line too; Booleano isn't picky about whitespace)

Please note the of the function depends_on(). That's the bit in charge of
checking whether the package whose name is represented in the function
argument is a dependency for the current package.

With Booleano you need to specify the operations explicitly; not necessarily
using a function-like notation though, since you could support the following
syntaxes too:
"X" belongsto dependencies
"X" belongsto package:dependencies
dependencies contain "X"
package:dependencies contain "X"
... and so on...

If you really just want to support only literals (e.g., "(X & Y | A & B) & G")
then I believe you'd be better off writing your own Pyparsing grammar.

HTH,

- Gustavo.
--
Gustavo Narea <xri://=Gustavo>.
| Tech blog: =Gustavo/(+blog)/tech ~ About me: =Gustavo/about |

Gustavo Narea

unread,
Nov 26, 2009, 7:24:04 PM11/26/09
to Bryan Bishop, bool...@googlegroups.com
Gustavo said:
> If you really just want to support only literals (e.g., "(X & Y | A & B) &
> G") then I believe you'd be better off writing your own Pyparsing
> grammar.

I mean, for the time being.

That's something that come in handy and I hope to support it in the future.

Cheers,
Reply all
Reply to author
Forward
0 new messages