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>
(cherry picked from commit 8ce142a255)
This commit is contained in:
Levente Polyak 2020-05-11 00:45:49 +02:00 committed by Andrew Gregory
parent 68418c5442
commit b3be0ce99b

View file

@ -526,7 +526,7 @@ find_libprovides() {
missing=0 missing=0
case "$p" in case "$p" in
*.so) *.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 if [[ $filename ]]; then
# packages may provide multiple versions of the same library # packages may provide multiple versions of the same library
for fn in "${filename[@]}"; do for fn in "${filename[@]}"; do