[pacman-dev] [PATCH] makepkg: deterministic PKGINFO libprovides for multiple library versions

anthraxx at archlinux.org anthraxx at archlinux.org
Sun May 10 22:45:49 UTC 2020

From: Levente Polyak <anthraxx at archlinux.org>

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 at archlinux.org>
 scripts/makepkg.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d1416d15..b95a03af 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -521,7 +521,7 @@ find_libprovides() {
 		case "$p" in
-				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

More information about the pacman-dev mailing list