Checksums don't work with multiple sources with same filename
When there are two or more files with the same filename in $source
, then abuild will not properly generate checksums and won't notice that the checksums are wrong when trying to build the package.
This is not a problem if the files are included in the aport dir, but it may lead to confusion. However, if both files were downloaded, and one doesn't notice it, it will lead to abuild not checking the checksums of at least one file with the same name.
Idea to fix this: exit with error if there are more than one file with the same filename in $source
.
Example:
$ tree
.
├── APKBUILD
├── dir1
│ └── testfile
└── dir2
└── testfile
2 directories, 3 files
$ cat dir1/testfile
first
$ cat dir2/testfile
second
$ abuild checksum
>>> checksums-test: Updating the sha512sums in APKBUILD...
$ cat APKBUILD
pkgname=checksums-test
pkgver=1
pkgrel=0
pkgdesc="reproducer"
url="https://postmarketos.org"
license="MIT"
arch="all"
source="dir1/testfile dir2/testfile"
package() {
mkdir -p "$pkgdir"
}
sha512sums="a7f76f090fcd3a897220845ad31254c754e1245065d91581ed8a801c6a7d276c7818bf2f0303ef9df9d2efd0c22c8a78ac6acc41f332ec91316f1b29eb4cc527 testfile
a7f76f090fcd3a897220845ad31254c754e1245065d91581ed8a801c6a7d276c7818bf2f0303ef9df9d2efd0c22c8a78ac6acc41f332ec91316f1b29eb4cc527 testfile"
$ abuild
...
>>> checksums-test: Checking sha512sums...
testfile: OK
testfile: OK
https://gitlab.com/ollieparanoid/reproducers/-/tree/master/abuild-checksums
Edited by Oliver Smith