On Fri, Mar 11, 2011 at 09:18, Nigel Kersten <[email protected]> wrote:
> On Fri, Mar 11, 2011 at 8:26 AM, James Turnbull <[email protected]> 
> wrote:
>>
>> Signed-off-by: James Turnbull <[email protected]>
>> ---
>>  lib/puppet/provider/package/aptitude.rb |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/lib/puppet/provider/package/aptitude.rb 
>> b/lib/puppet/provider/package/aptitude.rb
>> index 8bdf984..2eafd3e 100755
>> --- a/lib/puppet/provider/package/aptitude.rb
>> +++ b/lib/puppet/provider/package/aptitude.rb
>> @@ -12,6 +12,7 @@ Puppet::Type.type(:package).provide :aptitude, :parent => 
>> :apt, :source => :dpkg
>>     args.flatten!
>>     # Apparently aptitude hasn't always supported a -q flag.
>>     args.delete("-q") if args.include?("-q")
>> +    args.delete("--force-yes") if args.include?("--force-yes")
>>     output = aptitude(*args)
>>
>>     # Yay, stupid aptitude doesn't throw an error when the package is 
>> missing.

Are we really getting much value from inheriting the parent apt class
here, if we are having to tightly bind to the API?  Wouldn't it be
better to add a method "extra_apt_args" or something and allow
aptitude to override it, and not inject that in the first place?

Hrm.  The second looks like the right choice.  Oh, nice.  We also drop
the preseed interaction when purging with the aptitude provider,
because we override it.

> At the least we need a comment in this provider indicating that this
> argument comes from the parent provider apt, and doesn't work with
> aptitude.

It shouldn't be hard to modify the parent so the inherited class can
override that, and it *doesn't* turn up.

> I'll see if I can at least whip up a test for this specific case to
> get test coverage for the aptitude provider working.

That would be required if this is going to get in, otherwise it will
just regress when we add some other random argument that apt-get
understands but aptitude doesn't, but will never detect it.

Daniel
-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
✉ Daniel Pittman <[email protected]>
✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775
♲ Made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to