On Wednesday 25 October 2006 22:39, [EMAIL PROTECTED] wrote:
> > You mean /usr/ports/infrastructure/out-of-date? ;-)
[--snip--]
>
> Thanks! This type of info was what I was looking for.

I've written a script the other day that deals with this and updates 
your current apps based on out-of-date:

#!/usr/bin/env ruby


class PBuild
  attr_accessor :uplist
  attr_reader :flavor, :package
  def initialize(uplist = '/tmp/uplist')
    @uplist = uplist
  end
  def parse
    File.open(@uplist) do |file|
      file.each {|line| pkgadd(line)}
    end
  end
  def list
    `/usr/ports/infrastructure/build/out-of-date > [EMAIL PROTECTED]
  end
  def pkgadd(line)
    line =~ /((\S+)(\/)*)+/
    #port = $&
    flav = $&.split(',')
    @package = flav.first
    flav.delete(flav.first)
    @flavor = "env FLAVOR=\""
    if not flav.empty?
      flav.each do |opt|
        @flavor = @flavor + opt.to_s + ' '
      end
      p "Building package [EMAIL PROTECTED] with [EMAIL PROTECTED]"
      @flavor = @flavor + "\" make update clean"
    else
      p "Building package [EMAIL PROTECTED]"
      @flavor = "make update clean"
    end
    `cd /usr/ports/#{package} && [EMAIL PROTECTED]
  end
end

latest = PBuild.new
latest.list
latest.parse

Reply via email to