Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] eselect r745 - trunk/modules
Date: Tue, 29 Dec 2009 12:25:59
Message-Id: E1NPb9A-0005u5-4a@stork.gentoo.org
1 Author: ulm
2 Date: 2009-12-29 12:25:55 +0000 (Tue, 29 Dec 2009)
3 New Revision: 745
4
5 Modified:
6 trunk/modules/env.eselect
7 Log:
8 Make create_prelink_conf whitespace safe, too.
9
10 Modified: trunk/modules/env.eselect
11 ===================================================================
12 --- trunk/modules/env.eselect 2009-12-29 10:54:46 UTC (rev 744)
13 +++ trunk/modules/env.eselect 2009-12-29 12:25:55 UTC (rev 745)
14 @@ -187,7 +187,7 @@
15 create_prelink_conf() {
16 [[ -z ${ESELECT_LDPATH[@]} ]] \
17 && die -q "No LDPATHs found in ${EROOT}/etc/env.d/*"
18 - local str ifs_save
19 + local path prelink_path prelink_mask str x ifs_save
20 str="# prelink.conf autogenerated by eselect\n"
21 str="${str}# Make all changes to /etc/env.d files\n"
22 # Add default items
23 @@ -198,19 +198,20 @@
24 [[ -e ${EROOT}/${x} ]] && str="${str}-l ${EPREFIX}/${x}\n"
25 [[ -e ${EROOT}/usr/${x} ]] && str="${str}-l ${EPREFIX}/usr/${x}\n"
26 done
27 + path=$(load_config "${ENVPROFILE}" PATH)
28 + prelink_path=$(load_config "${ENVPROFILE}" PRELINK_PATH)
29 prelink_mask=$(load_config "${ENVPROFILE}" PRELINK_PATH_MASK)
30 - prelink_mask=( ${prelink_mask//:/ } )
31 - prelink=$(load_config "${ENVPROFILE}" PATH)
32 - prelink="${prelink} $(load_config "${ENVPROFILE}" PRELINK_PATH)"
33 - prelink=( ${prelink//:/ } "${ESELECT_LDPATH[@]}" )
34 - for x in "${prelink[@]}"; do
35 + ifs_save=${IFS-$' \t\n'}
36 + IFS=":"
37 + for x in ${path} ${prelink_path} "${ESELECT_LDPATH[@]}"; do
38 has ${x} ${prelink_mask} && continue
39 [[ -z ${x##*/} ]] || x="${x}/"
40 str="${str}-h ${x}\n"
41 done
42 - for x in "${prelink_mask[@]}"; do
43 + for x in ${prelink_mask}; do
44 str="${str}-b ${x}\n"
45 done
46 + IFS=${ifs_save}
47 echo -n -e "${str}" >"$(canonicalise "${PRELINK}")"
48 }