Subject: [alpine-devel] apk-tools/dependencies question for php

From: Natanael Copa <[email-masked]>
Date: Thu, 11 Feb 2010 16:03:37 +0100

So we have this package, php, which raises interesting questions about
dependencies.

we have 'php-cli', 'php' (php-cgi) and various php modules. Lets use
php-gd as an example.

php-imap does not make sense as a standalone, its just a .so file, so
it made sense to have 'php' as a dependency. You installed php-gd, it
pulled in php for you.

Now that we have php-cli in addition to php (cgi), and you can run
either of those with php-imap we can no longer pull in 'php' as
dependency since you might want to run the php-cli and not the cgi.

so how do we deal with that?

I can see those options:

1. remove the php dependency from php-dg (and all other php modules)
and let user handle the deps himself
2. implement optional/volunteer dependencies in apk-tools. You can as
user do something to tell apk that we want php-gd to be a dependency
for php when you install php, so when php is removed php-gd goes out
as well.
3. some other way to snap in dependencies manually afterwards. Like:
 # install php-gd and php-imap as dependencies for php
 apk add -d php php-gd php-imap
4. implement 'or' in apk-tools and let php-gd depend on either 'php or php-cli'

For now i think we will go for option 1, but it would be nice to hear
what you think would be the optimal solution for this situation.

Thanks!

-- 
Natanael Copa

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Carlo Landmeter <[email-masked]>
Date: Thu, 11 Feb 2010 22:30:17 +0100

Hi,

PHP is mainly used as a web scripting language right? I guess apk
should focus on PHP cgi instead of php-cli.
Lets say you install php-gd it will first look if php is installed, if
not then it will install php cgi and display a message about the other
options PHP which could have been installed (php-cli). If the users
would like cli he could install it afterwards and then remove php-cgi.
If php-cli would have been installed already it would ignore php-cgi.
I guess this way is similar then your #4? I guess making apk
interactive to choose your preferred php version is not
possible/suitable?

-carlo

---

---

From: Natanael Copa <[email-masked]>
Date: Fri, 12 Feb 2010 16:11:31 +0100

> should focus on PHP cgi instead of php-cli.

This was more a general question how to deal with this kind of dependencies.
 php-cgi.

> I guess this way is similar then your #4?

We want "provides" functionallity.

> I guess making apk interactive to choose your preferred php version is not
> possible/suitable?

Must not be interactive by default. you have -i option for interactivity though.

Thanks for input!

-- 
Natanael Copa

---

---

From: Cameron Banta <[email-masked]>
Date: Thu, 11 Feb 2010 16:13:55 -0600

> what you think would be the optimal solution for this situation.
Another option similar to 4 - could we do some kind of provides? Kind of
like openrc does.

So php-cli would provide php. So if you installed php-gd, it would install
php as dependency. But if you installed php-cli first, then php-gd wouldn't
install anything extra because it would think php was already installed.

-Cameron

---

From: Natanael Copa <[email-masked]>
Date: Fri, 12 Feb 2010 16:08:46 +0100

> On Thu, Feb 11, 2010 at 9:03 AM, Natanael Copa <[email-masked]>
...
> install anything extra because it would think php was already installed.

Yeah, i think this is what we want, "provides" functionallity.

Thanks!

-- 
Natanael Copa

---