anchor.diff:  %% ------------------------------------------------------------------
   
   init(Settings) ->
  -    VCSPlugins = ?GV(vcs_plugin, Settings),
  -    Plugins = lists:map(fun({Plugin, PluginSettings}) -> 
  -                {ok, Pid} = Plugin:start(PluginSettings),
  -                Pid end, VCSPlugins),
  +    VCSPlugins = ?GV(vcs_plugins, Settings),
  +    Plugins = init_plugins(VCSPlugins),
       Unpack = ?GV(unpack_dir, Settings),
  -    Stats = dets:open_file(
  -        ?GV(stats, Settings, "/var/lib/smprc/caterpillar/stats")),
  +    Deps = dets:open_file(
  +        ?GV(deps, Settings, "/var/lib/smprc/caterpillar/stats")),
       BuildQueue = queue:new(),
       WaitQueue = queue:new(),
  -    WorkerList = create_workers(?GV(build_workers_number, Settings, 5)),
  +    {ok, WorkerList} = create_workers(?GV(build_workers_number, Settings, 5)),
       {ok, #state{
               plugins=Plugins,
  -            stats=Stats,
  +            deps=Deps,
               unpack_dir=Unpack,
               main_queue=BuildQueue,
               wait_queue=WaitQueue,
  
positive.code: %% Internal Function Definitions
  %% ------------------------------------------------------------------
  
  -spec schedule_build(State :: record()) -> {ok, NewState :: record()}.
  schedule_build(State) when State#state.next_to_build == none ->
      get_build_candidate(State);
  schedule_build(State) ->
      {ok, State}.
  
  -spec get_build_candidate(State :: record()) -> {ok, NewState :: record()}.
  get_build_candidate(State) ->
      case {
              queue:is_empty(State#state.wait_queue),
              queue:is_empty(State#state.main_queue)} of
          {true, true} ->
              {ok, State};
          _Other -> %%TODO
              {ok, State}
      end.
  
  -spec create_workers(WorkerNumber :: non_neg_integer()) -> 
      {ok, [{Pid :: pid(), none}]}.
  create_workers(WorkerNumber) ->
  
negative.code: 
  handle_call({newref, RevDef}, _From, State) ->
      Queue = queue:in(RevDef, State#state.main_queue),
      QueuedState = State#state{main_queue=Queue},
      case State#state.next_to_build of
          none ->
              {ok, NewState} = schedule_build(QueuedState);
          _Other ->
              {ok, NewState} = try_build(QueuedState)
      end,
      {reply, ok, NewState};
  handle_call({built, _Worker}, _From, State) ->
      {ok, ScheduledState} = schedule_build(State),
      {ok, NewState} = try_build(ScheduledState),
      {reply, ok, NewState};
  handle_call(_Request, _From, State) ->
      {reply, ok, State}.
  