lib/solaris/patchdiag.rb
def successors(patch, ancestors=[])
      patch = Patch.new(patch.to_s)
      raise Solaris::Patch::SuccessorLoop,
        "Loop detected for patch #{patch} with ancestors #{ancestors.inspect}" if ancestors.include?(patch)
      ancestors << patch
      if ! patch.minor # patch has no minor number
        successors(latest(patch).patch, ancestors)
      elsif ! entry = find(patch).last # explicit patch not found
        latest_patch = latest(patch).patch
        raise Solaris::Patch::NotFound,
          "Patch #{patch} not found and has no later version" if latest_patch.minor <= patch.minor
        successors(latest_patch, ancestors)
      else
        if entry.obsolete?
          succ = entry.successor
          successors(succ, ancestors)
        elsif entry.bad?
          raise BadSuccessor, "Terminal successor #{patch} is bad/withdrawn"
        else
          ancestors
        end
      end
    end
# Return an array of Solaris::Patch of the successors to the given
# patch terminating in the latest non-obsolete successor (where that
# exists).
#
# Throws Solaris::Patch::NotFound if the patch or any of its named
# successors cannot be found in patchdiag.xref, or if no later version
# of the patch exists.
#
# Throws Solaris::Patch::SuccessorLoop if the successor of a patch refers
# to a patch that has already been referenced (an ancestor).
#
# The ancestors parameter is a recursion accumulator and should not
# normally be assigned to by callers.
Return an array of Solaris::Patch of the successors to the given
patch terminating in the latest non-obsolete successor (where that
exists).

Throws Solaris::Patch::NotFound if the patch or any of its named
successors cannot be found in patchdiag.xref, or if no later version
of the patch exists.

Throws Solaris::Patch::SuccessorLoop if the successor of a patch refers
to a patch that has already been referenced (an ancestor).

The ancestors parameter is a recursion accumulator and should not
normally be assigned to by callers.
Return an array of Solaris :: Patch of the successors to the given patch terminating in the latest non - obsolete successor ( where that exists ) . Throws Solaris :: Patch :: NotFound if the patch or any of its named successors cannot be found in patchdiag . xref or if no later version of the patch exists . Throws Solaris :: Patch :: SuccessorLoop if the successor of a patch refers to a patch that has already been referenced ( an ancestor ) . The ancestors parameter is a recursion accumulator and should not normally be assigned to by callers .
def successors(patch, ancestors=[])
      patch = Patch.new(patch.to_s)
      raise Solaris::Patch::SuccessorLoop,
        "Loop detected for patch #{patch} with ancestors #{ancestors.inspect}" if ancestors.include?(patch)
      ancestors << patch
      if ! patch.minor 
        successors(latest(patch).patch, ancestors)
      elsif ! entry = find(patch).last 
        latest_patch = latest(patch).patch
        raise Solaris::Patch::NotFound,
          "Patch #{patch} not found and has no later version" if latest_patch.minor <= patch.minor
        successors(latest_patch, ancestors)
      else
        if entry.obsolete?
          succ = entry.successor
          successors(succ, ancestors)
        elsif entry.bad?
          raise BadSuccessor, "Terminal successor #{patch} is bad/withdrawn"
        else
          ancestors
        end
      end
    end
def successors ( patch , ancestors = [ ] ) patch = Patch . new ( patch . to_s ) raise Solaris :: Patch :: SuccessorLoop , "Loop detected for patch #{patch} with ancestors #{ancestors.inspect}" if ancestors . include? ( patch ) ancestors << patch if ! patch . minor successors ( latest ( patch ) . patch , ancestors ) elsif ! entry = find ( patch ) . last latest_patch = latest ( patch ) . patch raise Solaris :: Patch :: NotFound , "Patch #{patch} not found and has no later version" if latest_patch . minor <= patch . minor successors ( latest_patch , ancestors ) else if entry . obsolete? succ = entry . successor successors ( succ , ancestors ) elsif entry . bad? raise BadSuccessor , "Terminal successor #{patch} is bad/withdrawn" else ancestors end end end
Return an array of Solaris::Patch of the successors to the given
patch terminating in the latest non-obsolete successor (where that
exists).
Return an array of Solaris :: Patch of the successors to the given patch terminating in the latest non - obsolete successor ( where that exists ) .
# patch has no minor number # explicit patch not found
patch
ancestors