diff --git a/debian/changelog b/debian/changelog index 8f2ac929..3dc83264 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +aptly (1.4.0+ds1-7) unstable; urgency=medium + + * Team upload. + * Add support for zstd compression (Closes: #1010465) + + -- Anton Gladky Tue, 17 May 2022 22:42:29 +0200 + aptly (1.4.0+ds1-6) unstable; urgency=medium * Conflict on gpgv1 (Closes: #990821) diff --git a/debian/control b/debian/control index 0abacac5..2aefc85c 100644 --- a/debian/control +++ b/debian/control @@ -17,6 +17,7 @@ Build-Depends: debhelper-compat (= 12), golang-github-smira-flag-dev, golang-github-smira-commander-dev, golang-gopkg-cheggaaa-pb.v1-dev, + golang-github-klauspost-compress-dev, golang-github-mattn-go-shellwords-dev, golang-github-smira-go-aws-auth-dev, golang-github-wsxiaoys-terminal-dev, diff --git a/debian/patches/series b/debian/patches/series index 63d0094e..883ced92 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ Fix-UUID-struct-field-not-encoded-in-msgpack.patch Fix-time.Time-msgpack-decoding-backwards-compatibili.patch s3-etag.patch +zstd.patch diff --git a/debian/patches/zstd.patch b/debian/patches/zstd.patch new file mode 100644 index 00000000..406a6471 --- /dev/null +++ b/debian/patches/zstd.patch @@ -0,0 +1,45 @@ +Description: Add support for zst compression +Origin: https://github.com/aptly-dev/aptly/pull/1050/files/e686753656b340abbb80c593f43879bfc9806cfd +Reviewed-By: Anton Gladky +Last-Update: 2022-04-29 + +Index: aptly/deb/deb.go +=================================================================== +--- aptly.orig/deb/deb.go ++++ aptly/deb/deb.go +@@ -16,6 +16,7 @@ import ( + + "github.com/aptly-dev/aptly/pgp" + "github.com/kjk/lzma" ++ "github.com/klauspost/compress/zstd" + "github.com/smira/go-xz" + ) + +@@ -74,6 +75,13 @@ func GetControlFileFromDeb(packageFile s + } + defer unxz.Close() + tarInput = unxz ++ case "control.tar.zst": ++ unzstd, err := zstd.NewReader(bufReader) ++ if err != nil { ++ return nil, errors.Wrapf(err, "unable to unzstd %s from %s", header.Name, packageFile) ++ } ++ defer unzstd.Close() ++ tarInput = unzstd + default: + return nil, fmt.Errorf("unsupported tar compression in %s: %s", packageFile, header.Name) + } +@@ -189,6 +197,13 @@ func GetContentsFromDeb(file io.Reader, + unlzma := lzma.NewReader(bufReader) + defer unlzma.Close() + tarInput = unlzma ++ case "data.tar.zst": ++ unzstd, err := zstd.NewReader(bufReader) ++ if err != nil { ++ return nil, errors.Wrapf(err, "unable to unzstd %s from %s", header.Name, packageFile) ++ } ++ defer unzstd.Close() ++ tarInput = unzstd + default: + return nil, fmt.Errorf("unsupported tar compression in %s: %s", packageFile, header.Name) + }