/[gentoo-x86]/eclass/gnustep-base.eclass
Gentoo

Diff of /eclass/gnustep-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 Revision 1.5
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.4 2007/10/05 10:51:20 voyageur Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.5 2007/10/08 19:34:04 voyageur Exp $
4 4
5inherit eutils flag-o-matic 5inherit eutils flag-o-matic
6 6
7# Inner gnustep eclass, should only be inherited directly by gnustep-base 7# Inner gnustep eclass, should only be inherited directly by gnustep-base
8# packages 8# packages
164egnustep_install_config() { 164egnustep_install_config() {
165 [[ $(type -t gnustep_config_script) != "function" ]] && return 0 165 [[ $(type -t gnustep_config_script) != "function" ]] && return 0
166 166
167 local cfile=config-${PN}.sh 167 local cfile=config-${PN}.sh
168 168
169 cat << EOF > "${T}"/${cfile} 169 cat << 'EOF' > "${T}"/${cfile}
170#!/usr/bin/env bash 170#!/usr/bin/env bash
171gnustep_append_default() { 171gnustep_append_default() {
172 if [[ -z \$1 || -z \$2 || -z \$3 ]]; then 172 if [[ -z $1 || -z $2 || -z $3 ]]; then
173 echo "warning: invalid script invocation" 173 echo "warning: invalid script invocation"
174 return 174 return
175 fi 175 fi
176 dom=\$1 176 dom=$1
177 key=\$2 177 key=$2
178 val=\$3 178 val=$3
179 cur=\$(defaults read \${dom} \${key}) 2> /dev/null 179 cur=$(defaults read ${dom} ${key}) 2> /dev/null
180 if [[ -z \$cur ]] ; then 180 if [[ -z $cur ]] ; then
181 echo " * setting \${dom} \${key}" 181 echo " * setting ${dom} ${key}"
182 defaults write \${dom} \${key} "( \${val} )" 182 defaults write ${dom} ${key} "( ${val} )"
183 elif [[ \${cur} != *\${val}* ]] ; then 183 elif [[ ${cur} != *${val}* ]] ; then
184 echo " * adding \${val} to \${dom} \${key}" 184 echo " * adding ${val} to ${dom} ${key}"
185 echo "\${cur%)\'}, \"\${val}\" )'" | defaults write 185 echo "${cur%)\'}, \"${val}\" )'" | defaults write
186 else 186 else
187 echo " * \${val} already present in \${dom} \${key}" 187 echo " * ${val} already present in ${dom} ${key}"
188 fi 188 fi
189} 189}
190 190
191gnustep_set_default() { 191gnustep_set_default() {
192 if [[ -z \$1 || -z \$2 || -z \$3 ]]; then 192 if [[ -z $1 || -z $2 || -z $3 ]]; then
193 echo "warning: invalid script invocation" 193 echo "warning: invalid script invocation"
194 return 194 return
195 fi 195 fi
196 dom=\$1 196 dom=$1
197 key=\$2 197 key=$2
198 val=\$3 198 val=$3
199 echo " * setting \${dom} \${key}" 199 echo " * setting ${dom} ${key}"
200 defaults write \${dom} \${key} \${val} 200 defaults write ${dom} ${key} ${val}
201} 201}
202 202
203echo "Applying ${P} default configuration ..."
204EOF 203EOF
204
205 echo "echo \"Applying ${P} default configuration ...\"" >> "${T}"/${cfile}
205 206
206 gnustep_config_script | \ 207 gnustep_config_script | \
207 while read line ; do 208 while read line ; do
208 echo "${line}" >> "${T}"/${cfile} 209 echo "${line}" >> "${T}"/${cfile}
209 done 210 done

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20