[wpkg-users] Regex in depend tag? Or other method?

Rainer Meier r.meier at wpkg.org
Thu Oct 9 18:22:44 CEST 2008


Hi,

Robin Roevens wrote:
> I'm fairly new to WPKG and considering to use it so at the moment I'm
> designing the packages and profiles that I'm hoping to use...
> But I stumbled on a practical problem: Some computers have/need firefox
> 1.5 and some have/need firefox 3.x .. So I have 2 packages: firefox15
> and firefox3
> But then I also have AdobeFlash-firefoxplugin as a package, which
> depends on firefox.. Can you already see my problem here?

Yes, if you need two different sets of software on different machines,
then you need to create a profile for each of them. You might either
completely duplicate it or create a profile with a common subset and
then create two concrete profiles depending on the common one (actually
inheriting its content) and adding the firefox package (one adds FF 1.5,
one adds FF 3.x).

Then assign the correct profiles to each host.


> Is there a way for this package to depend on firefox15 OR firefox3
> whatever is installed without having to create 2 seperate packages with
> the dependancy as the only difference.
> I was thinking about using a regex "firefox.+", but since it is nowhere
> documented, I assume it is not implemented in wpkg either and regexes
> only work on hosts?

No, regex is not supported for package references. This has a simple
reason. If you include or depend on a package you cannot specify a regex
as it could match multiple package (which is exactly the intention). If
it matches multiple packages, then WPKG does not know which one actually
to install.

Well, there might be a solution for it. Each package could provide a set
or "virtual" features where both Firefox packages could provide a
feature like "webbrowser" and you have a package depending on
"webbrowser". The drawback of this solution is the same as outlined
above. If no package providing "webbrowser" is installed WPKG does not
know which one to install.
Instead currently you can specify a direct dependency on another
package. If this package is not installed WPKG will take care about and
install it.
In your case you would need two Flash-Plugin packages, one depending on
FF 1.5 and one on FF 3.x, then just add the correct one to the profile
you create.

e.g.
profile: common
- package a
- package b
- package c
...

profile: users1
- depends on profile "common"
- package FF 1.5
- package FF-1-flash

profile: users2
- depends on profile "common"
- package FF 3.x
- package FF-3-flash


> Or is there some other decent method to handle this problem?

As written above. Use different profiles for different applications
installed.

> Even greater would probably be that there is a bit more version-control.
> So packages with a same name can exist as long as the revision differs.
> Then there could be dependencies to packages of at least revision x or
> with a revision lower than y and such.. and maybe even a stable and a
> testing/unstable branch, or is that going over the top? :-)

There is an idea to allow including of specific versions to a profile. I
will think about the possibility to create a dependency on a specific
version as well. However even if supported I would not recommend it. The
reason is simple - having a large package tree makes it difficult to
maintain the packages as you always have to upgrade some dependencies
and profiles which might still include the old version (leading to
invalid dependencies/profiles).


br,
Rainer



More information about the wpkg-users mailing list