You are not logged in.

#1 2010-05-17 16:33:15

Fractal
Member
From: Paris
Registered: 2009-09-01
Posts: 38

OR-depends (package depending on a or b)

Hi, I would like to create a package depending on stepmania OR stepmania-svn.
Is it possible?

Or perhaps I can do something like that:

[…]
# Uncomment the following line if you have stepmania-svn
#_stepmania_svn=yes
depends=($(if [[ -nz $_stepmania_svn ]]; then echo stepmania-svn; else echo stepmania; fi) )
[…]

I don't know if this kind of trick is allowed in AUR.

Or I could ask the stepmania-svn maintainer to add the line

provides=('stepmania')

in the PKGBUILD, but I don't know if we can say that stepmania-svn provide stepmania.

Thank you,


Fractal wink


English is not my native language, so fell free to correct my mistakes.

Offline

#2 2010-05-17 16:48:40

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: OR-depends (package depending on a or b)

I think the accepted approach for situations like this is to use the provides clause.

Offline

#3 2010-05-17 16:49:56

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: OR-depends (package depending on a or b)

The second way is the proper one in my view.  I say this b/c nearly all the -svn, -git packages I've seen provide their non-svn, non-git versions.  Is there a reason you don't know if we can say that stepmania-svn provides stepmania?

Offline

#4 2010-05-17 17:07:58

Fractal
Member
From: Paris
Registered: 2009-09-01
Posts: 38

Re: OR-depends (package depending on a or b)

brisbin33 wrote:

The second way is the proper one in my view.  I say this b/c nearly all the -svn, -git packages I've seen provide their non-svn, non-git versions.  Is there a reason you don't know if we can say that stepmania-svn provides stepmania?

The svn version is in alpha stage and for example the package stepmania-extras will probably not work with stepmania-svn.
And some people probably want to have both packages installed, but I don't know if the "provides" line would disallow that.

Thank you for your answers, I will ask the maintainer of stepmania-svn to add a "provides" line.


Another little problem I have is that I have to know whether Stepmania is installed in /opt/stepmania or /opt/stepmania-svn (or both).
Can I do something like

if pacman -Qq stepmania-svn &> /dev/null
then
   […]
else
   […]
fi

or even

if ls /opt/stepmania-svn &> /dev/null
then
   […]
else
   […]
fi

in the build function?


Fractal wink


English is not my native language, so fell free to correct my mistakes.

Offline

Board footer

Powered by FluxBB