You are not logged in.

#1 2023-10-08 01:55:56

D14852001neko
Member
Registered: 2009-04-25
Posts: 4

Package hash is different after install

I'm trying to create a new PKGBUILD for parpar-bin as the current one is out-of-date and the new release have the option for a static build (no more npm needed), but I found an interesting issue.

The release xz decompresses to the following b2sum:

$ wget -q https://github.com/animetosho/ParPar/releases/download/v0.4.2/parpar-v0.4.2-linux-static-amd64.xz -O parpar.xz; xz -d parpar.xz ; b2sum parpar
2990a1ccfcf195008e2554138e2fd1a256f4d18b32caadc7b6b2832024d0771e65ee30b73f94b7fd6937c866d55e756501857732e29a5098402a6751bc45b1d2  parpar

but the installed b2sum is different:

894e5e675dd21ecbfaa753d3a59c4e9433407569bd8f8111351a9b9b9b1fe0d0962249c7b97f0aa16ef5640cfa07c695aa7df3c6e71d9f9611c139cfc4491ac9  /usr/bin/parpar

so it fails it's own self-check:

$ parpar --help
Could not find self-check hash - this executable may be truncated or corrupt. If you are certain this is not a problem, you may use the `--skip-self-check` flag to bypass this check.

It seems that the installed parpar gets truncated at the very end:

$ diff <(xxd parpar) <(xxd /usr/bin/parpar)
1729792,1729794c1729792
< 01a64ff0: 0000 0000 0000 0000 003c 2170 6172 7061  .........<!parpa
< 01a65000: 7223 6d64 357e 3e3d 671a e9fd 97d8 a0b0  r#md5~>=g.......
< 01a65010: 698d dc75 ffb1 2a1b                      i..u..*.
---
> 01a64ff0: 0000 0000 0000 0000                      ........

The PKGBUILD I'm using is:

pkgname=parpar-bin
_pkgname=parpar
pkgver=0.4.2
pkgrel=1
pkgdesc='A high-performance, multithreaded PAR2 creation tool'
arch=('x86_64')
url='https://github.com/animetosho/ParPar'
license=('custom:CC0')
provides=('parpar')
conflicts=('parpar')
source=("${_pkgname}.xz::https://github.com/animetosho/ParPar/releases/download/v${pkgver}/${_pkgname}-v${pkgver}-linux-static-amd64.xz")
b2sums=('977bf88e211991dac2fa169213581f1bd2d34d40d3843ee7df5f4f23a90a8f2ea754b28bc0b2a2ff6f24dce9a88ef9cdce64a62562d4607c383190ef3619236b')

package() {
  install -Dm755 parpar ${pkgdir}/usr/bin/parpar
}

Any ideas?

Offline

#2 2023-10-08 01:58:48

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,628

Re: Package hash is different after install

It's being stripped.

Offline

#3 2023-10-08 02:01:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Package hash is different after install

Makepkg runs `strip` on binaries.  The two checksums you posted are exactly what I get for the stripped and unstripped binary.

(edit: too slow)

Last edited by Trilby (2023-10-08 02:02:13)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2023-10-08 02:06:51

D14852001neko
Member
Registered: 2009-04-25
Posts: 4

Re: Package hash is different after install

Aha! Thank you!

I added options and it works as intended.

options=('!strip')

Offline

Board footer

Powered by FluxBB