Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
Date: Mon, 31 Aug 2015 03:06:55
Message-Id: 1440990644.4311d97f2a466e82077d04130e20a4eb6e49ce80.blueness@gentoo
1 commit: 4311d97f2a466e82077d04130e20a4eb6e49ce80
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 31 03:10:44 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 31 03:10:44 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4311d97f
7
8 sys-libs/musl: remove old ldconfig script.
9
10 Package-Manager: portage-2.2.20.1
11
12 sys-libs/musl/files/ldconfig | 143 -------------------------------------------
13 1 file changed, 143 deletions(-)
14
15 diff --git a/sys-libs/musl/files/ldconfig b/sys-libs/musl/files/ldconfig
16 deleted file mode 100644
17 index be0aa2b..0000000
18 --- a/sys-libs/musl/files/ldconfig
19 +++ /dev/null
20 @@ -1,143 +0,0 @@
21 -#!/bin/bash -e
22 -# Copyright 1999-2015 Gentoo Foundation
23 -# Distributed under the terms of the GNU General Public License v2
24 -
25 -ROOT="/"
26 -
27 -LDSO_CONF="/etc/ld.so.conf"
28 -if [[ ! -e $LDSO_CONF ]]; then
29 - echo "$LDSO_CONF not found" >&2
30 - exit 1
31 -fi
32 -
33 -LDSO_CONF_DIR=$(dirname $LDSO_CONF)
34 -
35 -VERBOSE=0
36 -
37 -UPDATE_LINKS=1
38 -
39 -get_options() {
40 - while getopts "vnNXf:C:r:p" opt "$@"; do
41 - case $opt in
42 - v)
43 - echo "ldconfig for musl in Gentoo"
44 - VERBOSE=1
45 - ;;
46 - r)
47 - ROOT=$OPTARG
48 - ;;
49 - f)
50 - LDSO_CONF=$OPTARG
51 - ;;
52 - X)
53 - UPDATE_LINKS=0
54 - ;;
55 - \?)
56 - echo "Invalid option: -$opt" >&2
57 - exit 1
58 - ;;
59 - n|N|C|p)
60 - echo "Unimplemented option: -$opt" >&2
61 - exit 1
62 - ;;
63 - esac
64 - done
65 -
66 - if [[ $UPDATE_LINKS == 1 ]]; then
67 - echo "Updating links is not implemented."
68 - fi
69 -}
70 -
71 -
72 -repeated() {
73 - local l=$1
74 - local drs="${@:2}"
75 - for m in $drs; do
76 - [[ $m == $l ]] && return 0
77 - done
78 - return 1
79 -}
80 -
81 -expand() {
82 - # We are assuming the ld.so.conf's 'include' is not recursive
83 - local f line l
84 - local glob="$LDSO_CONF_DIR/$1"
85 - local drs="${@:2} "
86 -
87 - for f in $glob; do
88 - [[ ! -f $f ]] && continue
89 - while read line; do
90 - line=${line%%#*}
91 - line=${line//:/ }
92 - line=${line//,/ }
93 - for l in $line; do
94 - #We must add this whether or not the directory exists
95 - repeated $l $drs && continue
96 - drs+=" $l "
97 - done
98 - done < $f
99 - done
100 -
101 - echo $drs
102 -}
103 -
104 -read_ldso_conf() {
105 - local drs=" "
106 -
107 - while read line; do
108 - # Sanitize the line - see ldconfig(8) for delimiters
109 - # Note: bash read turns tabs into spaces and read already
110 - # delimits on newlines with the default $IFS
111 - line=${line%%#*} # Remove comments
112 - line=${line//:/ } # Change colon delimiter to space
113 - line=${line//,/ } # Change comma delimiter to space
114 -
115 - next=0
116 - for l in $line; do
117 - if [[ $next == 1 ]]; then
118 - next=0
119 - drs=$(expand $l $drs)
120 - elif [[ $l == "include" ]]; then
121 - next=1
122 - else
123 - # glibc's ldconfig silently skips non directories
124 - if [[ -d $l ]]; then
125 - repeated $l $drs && continue
126 - drs+=" $l "
127 - fi
128 - fi
129 - done
130 - done < $1
131 -
132 - echo $drs
133 -}
134 -
135 -sanitize() {
136 - local drs=$@
137 -
138 - repeated "/lib" $drs || drs="/lib $drs"
139 - repeated "/usr/lib" $drs || drs="/usr/lib $drs"
140 -
141 - echo $drs
142 -}
143 -
144 -get_options "$@"
145 -drs=$(read_ldso_conf "$LDSO_CONF")
146 -drs=$(sanitize $drs)
147 -
148 -LDSO_PATH=$(ls /lib/ld-musl-*.so.1)
149 -if [[ ! -e $LDSO_PATH ]]; then
150 - echo "$LDSO_PATH not found" >&2
151 - exit 1
152 -fi
153 -
154 -LDSO_ARCH=$(basename $LDSO_PATH)
155 -LDSO_NAME=${LDSO_ARCH%.so.1}
156 -ETC_LDSO_PATH=/etc/${LDSO_NAME}.path
157 -
158 -X=$(mktemp --tmpdir=/tmp ${LDSO_NAME}.XXXXXX)
159 -for d in $drs; do
160 - echo $d >> $X
161 -done
162 -chmod 644 $X
163 -mv $X $ETC_LDSO_PATH