On Saturday, July 5, 2014 9:22:38 PM UTC-5, David Mohl wrote:
>
> Hello,
>
> I am scratching my head on this one. For a project, I need to compile a 
> package from source that depends on a apt source package. Since I am 
> managing package sources with puppet, I need apt-get builddep to be 
> executed *after* sources have been added. 
>
> All my sources are managed inside the class 'sources' through apt::source. 
> However, when I require that class for builddep, I am falling into a huge 
> dependency cycle: (Anchor[apt::source::puppetlabs] => 
> Apt::Source[puppetlabs] => Class[Sources] => Apt::Builddep[something] => 
> Exec[apt-builddep-something] => Exec[apt_update] => Class[Apt::Update] => 
> Anchor[apt::source::puppetlabs])
>
> When I omit the requirement, puppet executes builddep before the sources 
> have been added and the command fails. 
>
> After a lot of debugging, trying and reading through the apt source, I 
> came to the conclusion that this is a problem inside apt. I am out of 
> ideas. 
> Does anyone here have a idea for this problem or should I start patching 
> apt? 
>


I'm not quite clear on what your class 'sources' is doing, or why it needs 
to do it via Apt::Source and yet also be applied before builddep.  Is there 
any chance that you are conflating the two very different meanings of 
"source" that are in play here?  Apt::Source is about managing Apt 
'sources', a.k.a. package repositories.  That has little directly to do 
with "source" in the sense of software source code.

Your class 'sources' needs to be applied before Apt::Builddep[something] 
only if it is managing an Apt *source* (e.g. a local repository); else it 
cannot have any effect on build-dep.  Remove the relationship if 
Class['sources'] is not managing an Apt source.

Your class 'sources' needs to be applied after Apt::Source[puppetlabs] only 
if it manages an Apt *package* that depends on a package from the 
'puppetlabs' Apt repository.  Remove the relationship if Class['sources'] 
is not managing such a package.

If Class['sources'] is doing both of the above then either split it into 
two classes, or move the relationship ends from the class itself to the 
appropriate resources inside.

If you split the class, then the part managing the Apt::Source must be 
applied before Apt::Builddep, but it needs no relationship with any other 
Apt::Source.  On the other hand, the part managing packages shouldn't need 
any direct dependencies on any of the Apt machinery, as the apt module 
already ensures that all Apt::Builddeps are run at an appropriate point.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8141a0e1-bd8f-4ce3-9627-6614c50eab1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to