anchor.diff:      var failures = [];
   
       for (var serverDir in listDir(systemCacheRoot)) {
  -      var url = _directoryToUrl(path.basename(serverDir));
  -      var packages = _getCachedPackagesInDirectory(path.basename(serverDir));
  +      var url = _directoryToUrl(p.basename(serverDir));
  +      var packages = _getCachedPackagesInDirectory(p.basename(serverDir));
         packages.sort(Package.orderByNameAndVersion);
   
         for (var package in packages) {
  
positive.code:   Future<Package> downloadToSystemCache(PackageId id) async {
      if (!isInSystemCache(id)) {
        var packageDir = getDirectory(id);
        ensureDir(path.dirname(packageDir));
        var parsed = _parseDescription(id.description);
        await _download(parsed.last, parsed.first, id.version, packageDir);
      }
  
negative.code: /// This behavior is a bug, but is being preserved for compatibility.
  String _urlToDirectory(String url) {
    // Normalize all loopback URLs to "localhost".
    url = url.replaceAllMapped(
        new RegExp(r"^(https?://)(127\.0\.0\.1|\[::1\]|localhost)?"),
        (match) {
      // Don't include the scheme for HTTPS URLs. This makes the directory names
      // nice for the default and most recommended scheme. We also don't include
      // it for localhost URLs, since they're always known to be HTTP.
      var localhost = match[2] == null ? '' : 'localhost';
      var scheme = match[1] == 'https://' || localhost.isNotEmpty ? '' : match[1];
      return "$scheme$localhost";
    });
    return replace(url, new RegExp(r'[<>:"\\/|?*%]'),
        (match) => '%${match[0].codeUnitAt(0)}');
  }
  