File: shlibs-add-udebs

package info (click to toggle)
glibc 2.24-11+deb9u4
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-proposed-updates
  • size: 225,852 kB
  • sloc: ansic: 996,505; asm: 261,827; sh: 10,484; makefile: 9,856; cpp: 4,169; python: 3,971; perl: 2,254; awk: 1,753; pascal: 1,521; yacc: 291; sed: 80
file content (45 lines) | stat: -rwxr-xr-x 1,404 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh
set -e

# This script adds "udeb lines" to shlibs files which allows other udebs
# to get correct dependencies when built against glibc libraries.
# The script was written by Frans Pop <fjp@debian.org>.

package="$1"
shlibs_file="debian/$package/DEBIAN/shlibs"

# Skip packages that don't have an shlibs file.
# The "cross-subarch" library packages have an shlibs file, but should
# not have udeb lines, so skip those as well.
if [ ! -r "$shlibs_file" ] || \
   echo "$package" | grep -Eq "^libc[0-9.]+-"; then
	exit 0
fi

# $1: regexp to select libraries for which lines should be duplicated
# $2: name of the udeb the new line should point to
add_udeb_line() {
	local regexp udeb line lib soname package rest
	regexp="$1"
	udeb="$2"

	if line="$(grep "^$regexp[[:space:]]" $shlibs_file)"; then
		echo "$line" | while read lib soname package rest; do
			echo "udeb: $lib $soname $udeb $rest" >>$shlibs_file
		done
	fi
}


W="[^[:space:]]*"

# The following lists should match the ones in the *-udeb.install files
# in debian/debhelper.in; $W replaces any "*" wildcards there.
expr_libc1="ld$W libm-$W libm libdl$W libresolv$W libc-$W libc"
expr_libc2="libutil$W libcrypt$W librt$W libpthread$W libmvec$W"
expr_libc3="libnss_dns$W libnss_files$W"
expr_hurd="libmachuser$W libhurduser$W"

for expr in $expr_libc1 $expr_libc2 $expr_libc3 $expr_hurd; do
	add_udeb_line "$expr" $package-udeb
done