Added '.xz' reader in HTTP download. This fixed issue when you try to mirror a distribution with only Packages.xz (example 'debian/experimental').

This commit is contained in:
Raphael Medaer
2016-04-27 18:03:22 +02:00
committed by Andrey Smirnov
parent ce0001f94c
commit db8595711b

View File

@@ -3,6 +3,7 @@ package http
import (
"compress/bzip2"
"compress/gzip"
"github.com/smira/go-xz"
"fmt"
"github.com/mxk/go-flowrate/flowrate"
"github.com/smira/aptly/aptly"
@@ -322,6 +323,10 @@ var compressionMethods = []struct {
extenstion: ".gz",
transformation: func(r io.Reader) (io.Reader, error) { return gzip.NewReader(r) },
},
{
extenstion: ".xz",
transformation: func(r io.Reader) (io.Reader, error) { return xz.NewReader(r) },
},
{
extenstion: "",
transformation: func(r io.Reader) (io.Reader, error) { return r, nil },