Puppet: System Administration Automated

Support

Ticket #838: dpkg-update.patch

File dpkg-update.patch, 0.7 kB (added by DavidS, 1 year ago)
  • a/lib/puppet/provider/package/dpkg.rb

    old new  
    5656        dpkg "-i", file 
    5757    end 
    5858 
     59    def update 
     60        self.install 
     61    end 
     62 
    5963    # Return the version from the package. 
    6064    def latest 
    6165        output = dpkg_deb "--show", @resource[:source] 
     66        matches = /^(\S+)\t(\S+)$/.match(output).captures 
     67        unless matches[0].match(@resource[:name]) 
     68            Puppet.warning "source doesn't contain named package, but %s" % matches[0] 
     69        end 
     70        matches[1] 
    6271    end 
    6372 
    6473    def query