Sun, 23 Nov 2025 13:15:19 +0100
optimize sorted insertion by using the infimum instead of the supremum
The reason is that the supremum returns the equal element with the smallest index, and we want the largest.
Therefore, we use the infimum, which already gives us the largest index when there are equal elements, and increase the index by one. The infimum is also guaranteed to exist in that case.
| 1457 | 1 | #!/bin/sh |
| 2 | ||
| 3 | if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] ; then | |
| 1484 | 4 | echo "Usage: $0 <version> <libdir> <includedir> [destdir]" |
| 1457 | 5 | exit 1 |
| 6 | fi | |
| 7 | ||
|
1458
053230cb6cfd
protect against possible spaces in the paths
Mike Becker <universe@uap-core.de>
parents:
1457
diff
changeset
|
8 | version="$1" |
|
053230cb6cfd
protect against possible spaces in the paths
Mike Becker <universe@uap-core.de>
parents:
1457
diff
changeset
|
9 | libdir="$2" |
|
053230cb6cfd
protect against possible spaces in the paths
Mike Becker <universe@uap-core.de>
parents:
1457
diff
changeset
|
10 | includedir="$3" |
| 1484 | 11 | destdir="$4" |
| 1457 | 12 | |
| 1484 | 13 | cat << EOF > "$destdir$libdir/pkgconfig/ucx.pc" |
| 1457 | 14 | libdir=$libdir |
| 15 | includedir=$includedir | |
| 16 | ||
| 17 | Name: ucx | |
| 18 | Description: UAP Common Extensions | |
| 19 | Version: $version | |
| 20 | Libs: -L\${libdir} -lucx | |
| 21 | Cflags: -I\${includedir} | |
| 22 | EOF |