Which class gets applied first?
Ryan Steele
ryans at aweber.com
Tue Nov 25 17:56:03 CET 2008
Thomas Lange wrote:
>>>>>> On Mon, 24 Nov 2008 16:15:38 -0500, Ryan Steele <ryans at aweber.com> said:
>>>>>>
>
> > Preface: using version 3.2.14
> > In a situation where the FAI client uses several classes that have
> > package_config files, are all the applicable package_config/ files
> > processed in a certain order, or at the same time?
> All package names from both classes are combined to a long list.
>
Thanks for the clarification. Might I suggest a tidbit of info in the
man page or the online documentation asserting this? I for one, found
the answer not to be (easily) self-evident (though others might object
to that claim).
>
> Maybe I should add an option for install_packages, which tells it to
> isntall packages in the order of classes instead of collecting all
> names to a long list.
>
I could see this as being potentially useful, so long as it wasn't the
default behavior. Though, I personally would rather have the ability to
specify things with even more granularity, such as a way to specify this
at the package level. E.g., I could have an option to specify a list of
packages that should be installed before the rest and in the order that
they are specified, but don't necessarily (or logically) belong in a
class all their own. Currently, our only recourse for doing so is a
hook to task_instsoft, which doesn't strike me as being a particularly
clean solution - it seems like more of an afterthought. Perhaps
something like this in the package_config/ files:
PACKAGES aptitude INSTALL_FIRST
packageA
packageB
packageC
...which would tell install_packages to move these to the very top of
the packages list in the order specified, so that they are the first
ones encountered by aptitude (or the package manager of choice). In
combination with your idea of installing packages in the order of
classes specified, we could have, with great flexibility and
granularity, a way to specify the order that packages are installed.
As a more concrete example, if I have two classes CLASS1 and CLASS2:
package_config/CLASS1:
PACKAGES aptitude INSTALL_FIRST
foo
bar
PACKAGES aptitude
baz
quux
...
package_config/CLASS2:
PACKAGES aptitude INSTALL_FIRST
locales
belocs-locales-bin
util-linux-locales
PACKAGES aptitude
package-that-depends-on-locales-being-set
otherpackages-that-depends-on-locales-being-set
...
I could then specify that CLASS2 be installed before CLASS1, and my
package list would get passed to aptitude as:
locales
belocs-locales-bin
util-linux-locales
foo
bar
...
package-that-depends-on-locales-being-set
otherpackages-that-depends-on-locales-being-set
...
baz
quux
Or, if I chose not to apply classes in the order they were defined but
kept the rest of the config the same, I would at least be guaranteed
that locales, belocs-locales-bin, util-linux-locales, foo, and bar would
be installed before the rest of the packages (even if those first 5
weren't in that specific order). Just a thought - it may be not be
desirable or even worth implementing, but I could certainly derive some
benefit from it (for example, up until recently in Intrepid Ibex, the
postgres-8.3 package for Ubuntu did not require locales be installed
first, which meant that I was basically stuck with the default 'C'
locale which resulted in SQL_ASCII encodings in my postgres, template0,
and template1 db's unless I installed postgres-8.3 in a pre-softinst
hook or a custom script, the latter of which I ended up doing.)
> I there a special reason for you that the packages are installed in
> the order of the classes?
>
Nope, in fact, I was hoping you would tell me what you did - that the
packages get coalesced in to one monolithic list. It's the way I'd
expect things to work, since apt/aptitude should be smart enough to
figure out which packages need to get installed before others (assuming
the package maintainers have done their job in specifying the Depends,
which as mentioned above, doesn't always happen ^_^).
Thanks a lot for your clarifications.
Respectfully,
Ryan
More information about the linux-fai
mailing list