summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-04-11 11:57:48 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-04-11 11:57:48 +0200
commit8bcbc69451bfb00977c16fdb03662c844f6e861e (patch)
tree06b5eded52faf5820685dd032d7d425b35e847bf
parentde97b0a56e3f454cab76aa475f40b10eed88333c (diff)
use xz-utils in the testcases instead of lzma and ensure that we really
ignore the presents (or absence) of lzma if we decided to use xz
-rw-r--r--apt-pkg/aptconfiguration.cc2
-rw-r--r--test/integration/framework2
-rwxr-xr-xtest/integration/test-bug-595691-empty-and-broken-archive-files12
3 files changed, 10 insertions, 6 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index d6691e392..d72b0c5ae 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -435,7 +435,7 @@ void Configuration::setDefaultConfigurationForCompressors() {
_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
_config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
- _config->CndSet("Dir::Bin::lzma", _config->Find("Dir::Bin::xz"));
+ _config->Clear("Dir::Bin::lzma");
_config->Set("APT::Compressor::lzma::Binary", "xz");
if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
_config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma");
diff --git a/test/integration/framework b/test/integration/framework
index fa4a98f58..0670d6a78 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -558,7 +558,7 @@ buildaptarchivefromfiles() {
msgninfo "\t${line} fileā€¦ "
cat ${line} | gzip > ${line}.gz
cat ${line} | bzip2 > ${line}.bz2
- cat ${line} | lzma > ${line}.lzma
+ cat ${line} | xz --format=lzma > ${line}.lzma
cat ${line} | xz > ${line}.xz
msgdone "info"
done
diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files
index bb1ac0e54..63883b380 100755
--- a/test/integration/test-bug-595691-empty-and-broken-archive-files
+++ b/test/integration/test-bug-595691-empty-and-broken-archive-files
@@ -28,10 +28,10 @@ testaptgetupdate() {
createemptyarchive() {
find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete
if [ "en" = "$1" ]; then
- echo -n "" | $COMPRESSOR > aptarchive/Packages.$COMPRESS
+ echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS
fi
touch aptarchive/Packages
- echo -n "" | $COMPRESSOR > aptarchive/${1}.$COMPRESS
+ echo -n "" | $COMPRESSOR_CMD > aptarchive/${1}.$COMPRESS
generatereleasefiles
signreleasefiles
rm -f aptarchive/Packages
@@ -40,7 +40,7 @@ createemptyarchive() {
createemptyfile() {
find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete
if [ "en" = "$1" ]; then
- echo -n "" | $COMPRESSOR > aptarchive/Packages.$COMPRESS
+ echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS
fi
touch aptarchive/Packages aptarchive/${1}.$COMPRESS
generatereleasefiles
@@ -50,6 +50,7 @@ createemptyfile() {
setupcompressor() {
COMPRESSOR="$1"
+ COMPRESSOR_CMD="$1"
case $COMPRESSOR in
gzip) COMPRESS="gz";;
bzip2) COMPRESS="bz2";;
@@ -66,10 +67,13 @@ Dir::Bin::xz \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor
echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor
elif [ -e "/usr/bin/${COMPRESSOR}" ]; then
echo "Dir::Bin::${COMPRESSOR} \"/usr/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor
+ elif [ "${COMPRESSOR}" = 'lzma' ]; then
+ echo "Dir::Bin::xz \"/usr/bin/xz\";" >> rootdir/etc/apt/apt.conf.d/00compressor
+ COMPRESSOR_CMD='xz --format=lzma'
else
msgtest "Test for availability of compressor" "${COMPRESSOR}"
msgfail
- exit 1
+ #exit 1
fi
}