acquire-item.cc: added support for xz-compressed pkglists

This commit is contained in:
Alexey Tourbin 2010-05-26 16:52:21 +04:00
parent 62198fabdc
commit 3d0bd9350a
2 changed files with 13 additions and 4 deletions

View File

@ -80,7 +80,8 @@ Patch101: apt-0.5.4cnc9-alt-getsrc-debug.patch
Requires: libapt = %version-%release
Requires: rpm >= 4.0.4-alt28, /etc/apt/pkgpriorities, apt-conf
# for methods.
Requires: bzip2, gzip, gnupg, alt-gpgkeys
Requires: gzip, bzip2, xz
Requires: gnupg, alt-gpgkeys
# for autopoint.
BuildPreReq: cvs
@ -321,6 +322,7 @@ install -pm644 %SOURCE1 %buildroot%_sysconfdir/%name/
# This is still needed.
ln -sf rsh %buildroot%_libdir/%name/methods/ssh
ln -sf gzip %buildroot%_libdir/%name/methods/bzip2
ln -sf gzip %buildroot%_libdir/%name/methods/xz
# Cleanup
find %buildroot%_includedir -type f -name rpmshowprogress.h -delete -print

View File

@ -191,7 +191,7 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,pkgRepository *Repository,
// Create the item
// CNC:2002-07-03
Desc.URI = URI + _config->Find("Acquire::ComprExtension", ".bz2");
Desc.URI = URI + ".bz2";
Desc.Description = URIDesc;
Desc.Owner = this;
Desc.ShortDesc = ShortDesc;
@ -227,6 +227,9 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,pkgRepository *Repository,
unlink(FinalFile.c_str());
unlink(DestFile.c_str());
}
if (Repository->FindChecksums(RealURI + ".xz", Size, MD5Hash) == true)
Desc.URI = URI + ".xz";
}
else if (Repository->IsAuthenticated() == true)
{
@ -360,11 +363,15 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string MD5,
Decompression = true;
DestFile += ".decomp";
// CNC:2002-07-03
Desc.URI = "bzip2:" + FileName;
const char *prog = "bzip2";
if (flExtension(Desc.URI) == "xz")
prog = "xz";
Desc.URI = string(prog) + ":" + FileName;
QueueURI(Desc);
// CNC:2002-07-03
Mode = "bzip2";
Mode = prog;
}
/*}}}*/