anchor.diff:              with e -> traceError (sprintf "could not delete %A" f)
   
   module AdditionalSources =
  +
  +    // register the logger
       Logging.event.Publish.Subscribe (fun a -> 
           match a.Level with
               | TraceLevel.Error -> traceError a.Text
  
positive.code:         else
              false
  
      let latestModificationDate (folder : string) =
          let file = DirectoryInfo(folder).GetFileSystemInfos("*", SearchOption.AllDirectories) |> Seq.maxBy (fun fi -> fi.LastWriteTime)
          file.LastWriteTime
  
      let installSources () =
          let sourceLines =
              if File.Exists sourcesFileName then 
  
negative.code:                 let path = Path.Combine(source, "bin", fileName)
                  let installPath = Path.Combine("packages", id)
  
                  if tryDeleteDir installPath && installPackage path then
                      tracefn "reinstalled %A" id
                  else
                      traceError <| sprintf "failed to reinstall: %A" id
  
          File.WriteAllLines(cacheFile, !cacheTimes |> Map.toSeq |> Seq.map (fun (a, time) -> sprintf "%s;%d" a time.Ticks))
  
      // add source-dependencies
      let addSources (folders : list<string>) = 
          
          let folders = folders |> List.filter Directory.Exists
          match folders with
              | [] -> 
                  traceImportant "no sources found"
              | folders ->
                  let taskName = sprintf "adding sources: %A" folders
                  traceStartTask taskName taskName
  
                  traceVerbose "reading sources.lock"
                  let sourceFolders =
                      if File.Exists sourcesFileName then 
                          File.ReadAllLines sourcesFileName |> Set.ofArray
                      else 
                          Set.empty
  
                  let newSourceFolders = Set.union (Set.ofList folders) sourceFolders
  
                  traceVerbose "writing to sources.lock"
                  File.WriteAllLines(sourcesFileName, newSourceFolders)
  
                  trace "restoring missing packages"
                  try paketDependencies.Restore()
                  with e -> traceError (sprintf "failed to restore packages: %A" e.Message)
  
                  installSources()
  
                  traceEndTask taskName taskName
  
      // remove source dependencies
      let removeSources (folders : list<string>) =
          let sourceFolders =
              if File.Exists sourcesFileName then 
                  File.ReadAllLines sourcesFileName |> Set.ofArray
              else 
                  Set.empty
  
          let newSourceFolders = Set.difference sourceFolders (Set.ofList folders)
  
          if Set.isEmpty newSourceFolders then
              deleteFile sourcesFileName
          else
              File.WriteAllLines(sourcesFileName, newSourceFolders)
  
          for f in folders do
              let packages = findCreatedPackages f
              for (id,v) in packages do
                  let path = Path.Combine("packages", id)
                  deleteDir path
  
  
          paketDependencies.Restore()
          installSources()
  
  
          