Skip to content

Commit

Permalink
disabled alternative uncompressed URIs
Browse files Browse the repository at this point in the history
When a compressed file: URI is requested, it checks to see if the
uncompressed file exsits, and uses that instead.  This isn't always
desireable, since e.g. zstd(1) is known for its very fast uncompression
which can be performed even as you read a file, but uncompressing the
whole file can eat up too much virtual memory.
  • Loading branch information
svpv committed Jul 14, 2017
1 parent 9c3f34e commit 295ffad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apt/apt-pkg/acquire-item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string MD5,
Erase = false;
Complete = true;

#if 0
// Handle the unzipd case
string FileName = LookupTag(Message,"Alt-Filename");
if (FileName.empty() == false)
Expand All @@ -457,8 +458,9 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string MD5,
Mode = "copy";
return;
}
#endif

FileName = LookupTag(Message,"Filename");
string FileName = LookupTag(Message,"Filename");
if (FileName.empty() == true)
{
Status = StatError;
Expand Down
2 changes: 2 additions & 0 deletions apt/apt-pkg/acquire-method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)

if (Alt != 0)
{
#if 0
if (Alt->Filename.empty() == false)
s << "Alt-Filename: " << Alt->Filename << "\n";

Expand All @@ -217,6 +218,7 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)

if (Alt->IMSHit == true)
s << "Alt-IMS-Hit: true\n";
#endif
}

s << "\n";
Expand Down
2 changes: 2 additions & 0 deletions apt/methods/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bool FileMethod::Fetch(FetchItem *Itm)
Res.IMSHit = true;
}

#if 0
// CNC:2003-11-04
// See if we can compute a file without a .gz/.bz2/etc extension
string ComprExtension = _config->Find("Acquire::ComprExtension", ".xz");
Expand All @@ -79,6 +80,7 @@ bool FileMethod::Fetch(FetchItem *Itm)
return true;
}
}
#endif

if (Res.Filename.empty() == true)
return _error->Error(_("File not found"));
Expand Down

0 comments on commit 295ffad

Please sign in to comment.