richardlehane / siegfried

signature-based file format identification
http://www.itforarchivists.com/siegfried
Apache License 2.0
214 stars 30 forks source link

Hard-code compression algorithm for Debian package #230

Closed paulmillar closed 1 year ago

paulmillar commented 1 year ago

Motivation:

Newer Ubuntu releases have changed the default compression from xz to zstd. The zstd compression is not supported by dpkg in "bullseye", the current stable release of Debian.

Modification:

Hard-code the compression algorithm to use the xz algorithm.

Result:

The debbuilder.sh script now produces packages that are compatible with Debian stable/bullseye.

Closes: #222

paulmillar commented 1 year ago

Please be aware that I haven't tested this change as much as I would like.

The Execute debbuilder script step in the publicDeb CI/CD job continues to work, but I haven't verified that the resulting deb file really uses xz (instead of zstd) compression.

richardlehane commented 1 year ago

thanks Paul, I'll check over the weekend, much appreciated :)

paulmillar commented 1 year ago

Just (possibly) to save you some time, you can check which algorithm is used with the ar command and looking at the file extensions:

paul@celebrimbor:~/git/siegfried (fix/issue-222)$ ar -t /var/cache/apt/archives/siegfried_1.9.5-1_amd64.deb 
debian-binary
control.tar.xz
data.tar.xz
paul@celebrimbor:~/git/siegfried (fix/issue-222)$ ar -t /var/cache/apt/archives/siegfried_1.10.0-1_amd64.deb 
debian-binary
control.tar.zst
data.tar.zst
paul@celebrimbor:~/git/siegfried (fix/issue-222)$ 

This isn't 100% proof (theoretically, a file ending .xz could still be compressed using zstd), but it's probably good enough.