Subject: [alpine-devel] The install_if feature in apk-tools

From: Natanael Copa <[email-masked]>
Date: Tue, 4 Jan 2011 09:41:33 +0100

Hi,

We are implementing a feature that we call "install_if" which will make
it possible to do proper language subpackages.

If we take squid as example, you have squid main application and a
subpackage with error messages. In the subpackage squid-lang-se you
have:

install_if="squid=$pkgver lang-se"

this means if you have squid installed (or pulled in as dependency) and
have added the 'lang-se' virtual package, you will automatically get
squid-lang-se pulled in.

In other words, you can do: 'apk add lang-se' and all packages that has
support for swedish language/locale will be pulled in.

This is alos useful for kernel flavours and 3rd party drivers.
Forexample, dahadi-linux-grsec could have:

install_if="linux-grsec=$_kernelver dahdi"

so if you install dahdi and have linux-grsec installed, then will the
dahdi-linux-grsec package be pulled in too. If you replace the
linux-grsec with linux-vserver then will also the kernel driver be
replaced with the proper driver package for that kernel.

Now I have a couple of questions:

* 1 language packs. Some packages has pretty many different locales.
  For example gtk+ has 107 different. I wonder if we should group them
  some how to keep number of packages down. Ideas on how to group the
  sanely? Or we accept that we suddenly get 1 zillion language packages?

* Do we want use-flags like features for things like mysql, radius etc?
  For example, if you install a virtual 'mysql-support' package, then
  will all packages that has a mysql plug automatically pull those in?
  For example, i you install php you'll get php-mysql pulled in. If you
  install asterisk and postfix will also asterisk-mysql and
  postfix-mysql be pulled in. If you uninstall the virtual
  'mysql-support' then will php-mysql, asterisk-mysql and postfix-mysql
  go with it. I am not sure how useful such 'mysql-support' feature
  will be.

Thoughts?

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

---

From: "Matt Smith" <[email-masked]>
Date: Sat, 8 Jan 2011 01:38:25 -0600 (CST)

On Tuesday, January 4, 2011 2:41am, "Natanael Copa" <[email-masked]>
said:

..snip..
>   go with it. I am not sure how useful such 'mysql-support' feature

IMHO, use-flags was just another one of those features that scared me
away from using Gentoo Linux.

For instance, this is just horrifying:
http://www.gentoo.org/dyn/use-index.xml

On one hand, I think use-flags could be a great thing, but on the other,
I just don't want to see it get out of hand, or be forced on the user in
order to use the system.  I think if those 'rules' could be followed, then
we could enjoy use-flags.

Matt

---

---

From: Timo Teräs <[email-masked]>
Date: Sat, 08 Jan 2011 10:24:19 +0200

> http://www.gentoo.org/dyn/use-index.xml

Yes, that's a horribly long list to go through.

> we could enjoy use-flags.

The idea on install_if is that it's completely optional. You can always
install your packages on per-package basis, and you never need to
install the virtual targets.

However, install_if gives you a great help, if you just want some
feature X to work. Like "make all programs localized to Norwegian". It'd
be single command: "apk add lang-no" instead of going through all the
packages having Norwegian support and installing the them one by one.

---

---

From: "Matt Smith" <[email-masked]>
Date: Sat, 8 Jan 2011 02:41:24 -0600 (CST)

> packages having Norwegian support and installing the them one by one.

Sounds fair.

On the language packs, would you be leaning more towards virtual packages
or some sort of use-flags?

Other than that, what do you think about using use-flags for installing the
software packages?

Matt

---

---

From: Timo Teräs <[email-masked]>
Date: Sat, 08 Jan 2011 10:46:08 +0200

> Other than that, what do you think about using use-flags for installing the

Well. From the apk point of view they are virtual packages. From the
user point of view, they are more like "use flags". Since if you install
the virtual master package 'lang-XX' you will get that feature from all
installed packages.

I personally think that "apk add lang-XX" is better than "edit file
/etc/apk/config and add lang-XX to line y". From practical point of
view, they do the same thing.

>From APKBUILD point of view, they are more like use flags. You just need
to split the package for each "use flag" properly.

I don't mind if we call them as "virtual targets" or "use flags" as long
as they are easy to install :)

- Timo

---

---

From: "Matt Smith" <[email-masked]>
Date: Sat, 8 Jan 2011 02:56:54 -0600 (CST)

> as they are easy to install :)

That's exactly what I'm thinking: it must be easy to install.

I'm totally on-board for 'virtual packages'.

Matt

---