anchor.diff:    try {
       var client = new IOClient();
   
  -    Stream stream;
       try {
  -      stream = await downloadPackage(packageName, client);
  +      var info = await getPackageInfo(packageName, client);
   
  -      log.info('Extracting to ${tempDir.path}');
  -      await extractTarGz(stream, tempDir.path);
  -      log.info('Extracted to ${tempDir.path}');
  +      var latest = info['latest'];
  +
  +      var version = latest['version'];
  +      log.info('Version $version');
  +
  +      var archiveUri = Uri.parse(latest['archive_url']);
  +
  +      await downloadAndExtract(tempDir.path, archiveUri, client);
       } finally {
         client.close();
       }
  
positive.code:   }
  }
  
  Future<Stream<List<int>>> downloadPackage(
      String packageName, Client client) async {
    var pkgUri = 'https://pub.dartlang.org/api/packages/$packageName';
    log.info('Downloading $pkgUri');
  
    var response = await client.read(pkgUri);
  
    var json = JSON.decode(response);
  
    var latest = json['latest'];
  
    var version = latest['version'];
    log.info('Version $version');
  
    var archiveUri = Uri.parse(latest['archive_url']);
  
    log.info('Downloading $archiveUri');
    assert(archiveUri.toString().endsWith('.tar.gz'));
  
  
negative.code:     throw "Analyzer failed with exit code $code";
    }
  
    return items;
  }
  
  Future<List<String>> getLibraries(String projectDir) async {
  