1 |
voyageur 07/10/05 10:51:21 |
2 |
|
3 |
Modified: gnustep-base.eclass |
4 |
Log: |
5 |
Update convenience scripts generation from the gnustep overlay |
6 |
|
7 |
Revision Changes Path |
8 |
1.4 eclass/gnustep-base.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnustep-base.eclass?rev=1.4&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnustep-base.eclass?rev=1.4&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnustep-base.eclass?r1=1.3&r2=1.4 |
13 |
|
14 |
Index: gnustep-base.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v |
17 |
retrieving revision 1.3 |
18 |
retrieving revision 1.4 |
19 |
diff -u -r1.3 -r1.4 |
20 |
--- gnustep-base.eclass 17 Sep 2007 10:58:04 -0000 1.3 |
21 |
+++ gnustep-base.eclass 5 Oct 2007 10:51:20 -0000 1.4 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2007 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.3 2007/09/17 10:58:04 grobian Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.4 2007/10/05 10:51:20 voyageur Exp $ |
27 |
|
28 |
inherit eutils flag-o-matic |
29 |
|
30 |
@@ -166,8 +166,43 @@ |
31 |
|
32 |
local cfile=config-${PN}.sh |
33 |
|
34 |
- echo '#!/usr/bin/env bash' > "${T}"/${cfile} |
35 |
- echo "echo Applying ${P} default configuration ..." >> "${T}"/${cfile} |
36 |
+ cat << EOF > "${T}"/${cfile} |
37 |
+#!/usr/bin/env bash |
38 |
+gnustep_append_default() { |
39 |
+ if [[ -z \$1 || -z \$2 || -z \$3 ]]; then |
40 |
+ echo "warning: invalid script invocation" |
41 |
+ return |
42 |
+ fi |
43 |
+ dom=\$1 |
44 |
+ key=\$2 |
45 |
+ val=\$3 |
46 |
+ cur=\$(defaults read \${dom} \${key}) 2> /dev/null |
47 |
+ if [[ -z \$cur ]] ; then |
48 |
+ echo " * setting \${dom} \${key}" |
49 |
+ defaults write \${dom} \${key} "( \${val} )" |
50 |
+ elif [[ \${cur} != *\${val}* ]] ; then |
51 |
+ echo " * adding \${val} to \${dom} \${key}" |
52 |
+ echo "\${cur%)\'}, \"\${val}\" )'" | defaults write |
53 |
+ else |
54 |
+ echo " * \${val} already present in \${dom} \${key}" |
55 |
+ fi |
56 |
+} |
57 |
+ |
58 |
+gnustep_set_default() { |
59 |
+ if [[ -z \$1 || -z \$2 || -z \$3 ]]; then |
60 |
+ echo "warning: invalid script invocation" |
61 |
+ return |
62 |
+ fi |
63 |
+ dom=\$1 |
64 |
+ key=\$2 |
65 |
+ val=\$3 |
66 |
+ echo " * setting \${dom} \${key}" |
67 |
+ defaults write \${dom} \${key} \${val} |
68 |
+} |
69 |
+ |
70 |
+echo "Applying ${P} default configuration ..." |
71 |
+EOF |
72 |
+ |
73 |
gnustep_config_script | \ |
74 |
while read line ; do |
75 |
echo "${line}" >> "${T}"/${cfile} |
76 |
|
77 |
|
78 |
|
79 |
-- |
80 |
gentoo-commits@g.o mailing list |