Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for zst compression #1050

Merged
merged 3 commits into from
Apr 4, 2022
Merged

Conversation

mbearup
Copy link
Contributor

@mbearup mbearup commented Mar 22, 2022

Fixes #

Requirements

All new code should be covered with tests, documentation should be updated. CI should pass.

Description of the Change

Adds support for zst compression. This is just a re-attempt at PR #1002 since that one seems to be stalled.

Checklist

  • unit-test added (if change is algorithm)
  • functional test added/updated (if change is functional)
  • man page updated (if applicable)
  • bash completion updated (if applicable)
  • documentation updated
  • author name in AUTHORS

@randombenj
Copy link
Contributor

Thanks for this change! Could you drop support for 1.14 as with the new package some checks seem to fail

@mbearup
Copy link
Contributor Author

mbearup commented Mar 29, 2022

Removed 1.14 from ci.yml. Let me know if anything else I should change. Looks like CI re-run needs to be approved as well.

@randombenj
Copy link
Contributor

@mbearup Thanks for the changes, could you please add a unit test for this change? Something similar to https://github.com/aptly-dev/aptly/blob/master/deb/deb_test.go#L42

@NeroBurner
Copy link
Contributor

NeroBurner commented Apr 4, 2022

Like in #658 we can use http://ddebs.ubuntu.com/pool/universe/q/qtbase-opensource-src/libqt5concurrent5-dbgsym_5.15.2+dfsg-12_amd64.ddeb as test file for the new unit tests as it is zstd compressed

This is the official Ubuntu 21.10 impish ddeb file listed in http://ddebs.ubuntu.com/dists/impish/universe/binary-amd64/Packages for the package libqt5concurrent5-dbgsym

edit: add information from Packages about the ddeb

Package: libqt5concurrent5-dbgsym
Package-Type: ddeb
Architecture: amd64
Version: 5.15.2+dfsg-12
Auto-Built-Package: debug-symbols
Multi-Arch: same
Priority: optional
Section: debug
Source: qtbase-opensource-src
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Installed-Size: 227
Depends: libqt5concurrent5 (= 5.15.2+dfsg-12)
Filename: pool/universe/q/qtbase-opensource-src/libqt5concurrent5-dbgsym_5.15.2+dfsg-12_amd64.ddeb
Size: 212504
MD5sum: 2a061010b137959daf783d0d1c6759d2
SHA1: e88cf4434207c9971a585d868d5527c87ce0dd7f
SHA256: 756d5b6f1f5b773d9d1cee0c642dbf6e7ceb1e9af1cef5590ffb34673a62233c
SHA512: 3303d6d970233ef9065eef30ac419c8e3ac452f3a7eada857330edbf3a2c82cfe21bfd7aebf7d6e9a68912f54d3ac35ddc826151f9130e8286772ce198cce929
Description: debug symbols for libqt5concurrent5
Build-Ids: 59514d09f713f0b6c99ab4415f155d3279cddd14

edit2: add proposal for new test function using mentioned ddeb file

type DebSuite struct {
-	debFile, debFile2, debFileWithXzControl, dscFile, dscFileNoSign string
+	debFile, debFile2, debFileWithXzControl, debFileWithZstdControl, dscFile, dscFileNoSign string
}

var _ = Suite(&DebSuite{})

func (s *DebSuite) SetUpSuite(c *C) {
	_, _File, _, _ := runtime.Caller(0)
	s.debFile = filepath.Join(filepath.Dir(_File), "../system/files/libboost-program-options-dev_1.49.0.1_i386.deb")
	s.debFile2 = filepath.Join(filepath.Dir(_File), "../system/changes/hardlink_0.2.1_amd64.deb")
	s.debFileWithXzControl = filepath.Join(filepath.Dir(_File), "../system/changes/libqt5concurrent5-dbgsym_5.9.1+dfsg-2+18.04+bionic+build4_amd64.ddeb")
+	s.debFileWithZstdControl = filepath.Join(filepath.Dir(_File), "../system/changes/libqt5concurrent5-dbgsym_5.15.2+dfsg-12_amd64.ddeb")
	s.dscFile = filepath.Join(filepath.Dir(_File), "../system/files/pyspi_0.6.1-1.3.dsc")
	s.dscFileNoSign = filepath.Join(filepath.Dir(_File), "../system/files/pyspi-0.6.1-1.3.stripped.dsc")
}
func (s *DebSuite) TestGetControlFileFromDebWithZstdControl(c *C) {
	// Has control.tar.zstd archive inside.
	st, err := GetControlFileFromDeb(s.debFileWithZstdControl)
	c.Check(err, IsNil)
	c.Check(st["Version"], Equals, "5.15.2+dfsg-12")
	c.Check(st["Package"], Equals, "libqt5concurrent5-dbgsym")
}

@NeroBurner
Copy link
Contributor

created a commit NeroBurner@12b829d
https://github.com/NeroBurner/aptly/tree/zstd_compression

feel free to cherry-pick/squash-merge

git remote add neroburner https://github.com/NeroBurner/aptly.git
git fetch neroburner zstd_compression
git cherry-pick neroburner/zstd_compression

or I can open a PR as well, anything that helps :)

@randombenj randombenj self-requested a review April 4, 2022 15:46
Copy link
Contributor

@randombenj randombenj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @mbearup and the original changes from @ahaswell
and for the test @NeroBurner.

@randombenj randombenj merged commit c1e577c into aptly-dev:master Apr 4, 2022
@mbearup
Copy link
Contributor Author

mbearup commented Apr 4, 2022

Thanks all for getting this across the finish line!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants