makepkg: deterministic PKGINFO libprovides for multiple library versions

While iterating over the provides array, the find call for locating a
shared library may result in listing multiple entries which by itself
does not produce a stable deterministic order and may vary depending on
the underlying filesystem.
To provide a stable listing and a reproducible .PKGINFO file the result
of find is piped to sort with a static LC_ALL=C localisation.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Levente Polyak 2020-05-11 00:45:49 +02:00 committed by Allan McRae
parent 8e769ddb8a
commit 8ce142a255

View file

@ -521,7 +521,7 @@ find_libprovides() {
missing=0
case "$p" in
*.so)
mapfile -t filename < <(find "$pkgdir" -type f -name $p\*)
mapfile -t filename < <(find "$pkgdir" -type f -name $p\* | LC_ALL=C sort)
if [[ $filename ]]; then
# packages may provide multiple versions of the same library
for fn in "${filename[@]}"; do