File: shlibs-add-udebs

package info (click to toggle)
glibc 2.41-10
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 300,192 kB
  • sloc: ansic: 1,050,471; asm: 238,243; makefile: 20,378; python: 13,537; sh: 11,823; cpp: 5,197; awk: 1,795; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (49 lines) | stat: -rwxr-xr-x 1,515 bytes parent folder | download | duplicates (18)
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
46
47
48
49
#! /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 librt$W libpthread$W libmvec$W"
expr_libc3="libnss_dns$W libnss_files$W"
expr_hurd="libmachuser$W libhurduser$W"

# Remove udeb entries wrongly added by dh_makeshlibs (see bugs #934889
# and #934891)
sed -i -e '/^udeb:/d' $shlibs_file

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