summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-02-22 12:50:47 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-02-22 12:50:47 +0100
commitbc33e0f0b6b1fdb010dcd4a49a78b827530052aa (patch)
tree210d986981e3959b46ddb79744f3a68ea963b689
parent0ff1a4556c0a0fb76ce48e88031eff2b4d613c5e (diff)
* ftparchive/multicompress.cc, apt-inst/deb/debfile.cc:
- support xz compressor to create xz-compressed Indexes and be able to open data.tar.xz files
-rw-r--r--apt-inst/deb/debfile.cc8
-rw-r--r--debian/changelog5
-rw-r--r--ftparchive/contents.cc6
-rw-r--r--ftparchive/multicompress.cc1
-rw-r--r--test/integration/framework8
5 files changed, 22 insertions, 6 deletions
diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc
index cd7a88808..edd78adbb 100644
--- a/apt-inst/deb/debfile.cc
+++ b/apt-inst/deb/debfile.cc
@@ -46,7 +46,9 @@ debDebFile::debDebFile(FileFd &File) : File(File), AR(File)
if (!CheckMember("data.tar.gz") &&
!CheckMember("data.tar.bz2") &&
- !CheckMember("data.tar.lzma")) {
+ !CheckMember("data.tar.lzma") &&
+ !CheckMember("data.tar.xz")) {
+ // FIXME: add data.tar.xz here - adding it now would require a Translation round for a very small gain
_error->Error(_("This is not a valid DEB archive, it has no '%s', '%s' or '%s' member"), "data.tar.gz", "data.tar.bz2", "data.tar.lzma");
return;
}
@@ -136,6 +138,10 @@ bool debDebFile::ExtractArchive(pkgDirStream &Stream)
Member = AR.FindMember("data.tar.lzma");
Compressor = "lzma";
}
+ if (Member == 0) {
+ Member = AR.FindMember("data.tar.xz");
+ Compressor = "xz";
+ }
if (Member == 0)
return _error->Error(_("Internal error, could not locate member"));
if (File.Seek(Member->Start) == false)
diff --git a/debian/changelog b/debian/changelog
index b3907ac0f..bf72e350d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,8 +13,11 @@ apt (0.8.10.3+squeeze1) UNRELEASED; urgency=low
* apt-pkg/contrib/fileutl.cc:
- reorder the loaded filesize bytes for big endian (Closes: #612986)
Thanks to Jörg Sommer for the detailed analyse!
+ * ftparchive/multicompress.cc, apt-inst/deb/debfile.cc:
+ - support xz compressor to create xz-compressed Indexes and be able
+ to open data.tar.xz files
- -- David Kalnischkies <kalnischkies@gmail.com> Tue, 22 Feb 2011 11:25:58 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com> Tue, 22 Feb 2011 12:47:31 +0100
apt (0.8.10.3) unstable; urgency=low
diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc
index b761d9204..9e283cf33 100644
--- a/ftparchive/contents.cc
+++ b/ftparchive/contents.cc
@@ -318,8 +318,12 @@ bool ContentsExtract::Read(debDebFile &Deb)
Compressor = "lzma";
}
if (Member == 0) {
+ Member = Deb.GotoMember("data.tar.xz");
+ Compressor = "xz";
+ }
+ if (Member == 0) {
_error->Error(_("Internal error, could not locate member %s"),
- "data.tar.{gz,bz2,lzma}");
+ "data.tar.{gz,bz2,lzma,xz}");
return false;
}
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index bb4beedf9..c33414a11 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -35,6 +35,7 @@ const MultiCompress::CompType MultiCompress::Compressors[] =
{"gzip",".gz","gzip","-9n","-d",2},
{"bzip2",".bz2","bzip2","-9","-d",3},
{"lzma",".lzma","lzma","-9","-d",4},
+ {"xz",".xz","xz","-6","-d",5},
{}};
// MultiCompress::MultiCompress - Constructor /*{{{*/
diff --git a/test/integration/framework b/test/integration/framework
index 2422f0886..6545cf3ce 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -251,9 +251,9 @@ createaptftparchiveconfig() {
echo -n '";
};
Default {
- Packages::Compress ". gzip bzip2 lzma";
- Sources::Compress ". gzip bzip2 lzma";
- Contents::Compress ". gzip bzip2 lzma";
+ Packages::Compress ". gzip bzip2 lzma xz";
+ Sources::Compress ". gzip bzip2 lzma xz";
+ Contents::Compress ". gzip bzip2 lzma xz";
};
TreeDefault {
Directory "pool/";
@@ -332,6 +332,7 @@ buildaptarchivefromfiles() {
cat Packages | gzip > Packages.gz
cat Packages | bzip2 > Packages.bz2
cat Packages | lzma > Packages.lzma
+ cat Packages | xz > Packages.xz
msgdone "info"
fi
if [ -f Sources ]; then
@@ -339,6 +340,7 @@ buildaptarchivefromfiles() {
cat Sources | gzip > Sources.gz
cat Sources | bzip2 > Sources.bz2
cat Sources | lzma > Sources.lzma
+ cat Sources | xz > Sources.xz
msgdone "info"
fi
msgninfo "\tRelease file… "