Apt: Execute sources before builddep

ยอดดู 22 ครั้ง
ข้ามไปที่ข้อความที่ยังไม่อ่านรายการแรก

David Mohl

ยังไม่อ่าน,
5 ก.ค. 2557 22:22:385/7/57
ถึง puppet...@googlegroups.com
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? 



Cheers,
David

Wolf Noble

ยังไม่อ่าน,
7 ก.ค. 2557 01:55:517/7/57
ถึง <puppet-users@googlegroups.com>
Hi David,

I've seen a setup that has an exec which fires apt-get update. This exec has refreshonly => true. All Apt::Source resources are instantiated via a profile class kicking off create_resources. All Apt::Source resources notify the apt-get update exec.

I think something similar to that should give you the ability to have a class/package require the apt-get update exec, and achieve the behavior you desire.


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d22156cf-87e9-4ff1-951f-e6e6038aeb21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jcbollinger

ยังไม่อ่าน,
7 ก.ค. 2557 10:26:087/7/57
ถึง puppet...@googlegroups.com


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

ตอบทุกคน
ตอบกลับผู้สร้าง
ส่งต่อ
ข้อความใหม่ 0 รายการ