Gentoo Archives: gentoo-commits

From: "Devan Franchini (twitch153)" <twitch153@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-admin/webapp-config/files: webapp-config-1.52-nulls-doctest.patch
Date: Sat, 04 Jan 2014 23:39:38
Message-Id: 20140104233934.A55A32004C@flycatcher.gentoo.org
1 twitch153 14/01/04 23:39:34
2
3 Added: webapp-config-1.52-nulls-doctest.patch
4 Log:
5 Adds webapp-config-1.52-r1 and patch file to null doctest code, bug #430010
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key )
8
9 Revision Changes Path
10 1.1 app-admin/webapp-config/files/webapp-config-1.52-nulls-doctest.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webapp-config/files/webapp-config-1.52-nulls-doctest.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/webapp-config/files/webapp-config-1.52-nulls-doctest.patch?rev=1.1&content-type=text/plain
14
15 Index: webapp-config-1.52-nulls-doctest.patch
16 ===================================================================
17 From 5f61d249507c3502c3c76faf3926522e6e63370d Mon Sep 17 00:00:00 2001
18 From: Devan Franchini <twitch153@g.o>
19 Date: Fri, 3 Jan 2014 21:03:00 -0500
20 Subject: [PATCH] WebappConfig/{ebuild,content}.py: Nulls doctest code.
21
22 Due to the variable nature of the returning values of the two functions
23 run_vars() and add(), it is unrealistic to depend on doctest to not
24 fail. It has been decided that disabling these two doctest codes would
25 be the best decision to prevent failures that are not detrimental.
26
27 X-Gentoo-Bug: 430010
28 X-Gentoo-Bug-URL: https://bugs.gentoo.org/430010
29 ---
30 WebappConfig/content.py | 36 ++++++++++++++++++------------------
31 WebappConfig/ebuild.py | 46 +++++++++++++++++++++++-----------------------
32 2 files changed, 41 insertions(+), 41 deletions(-)
33
34 diff --git a/WebappConfig/content.py b/WebappConfig/content.py
35 index 8fe5be9..c635f5a 100644
36 --- a/WebappConfig/content.py
37 +++ b/WebappConfig/content.py
38 @@ -379,71 +379,71 @@ class Contents:
39 (and this is important for md5)
40 relative - 1 for storing a relative filename, 0 otherwise
41
42 - >>> OUT.color_off()
43 - >>> import os.path
44 - >>> here = os.path.dirname(os.path.realpath(__file__))
45 + OUT.color_off()
46 + import os.path
47 + here = os.path.dirname(os.path.realpath(__file__))
48
49 One for pretending:
50
51 - >>> a = Contents(here + '/tests/testfiles/contents/app/',
52 + a = Contents(here + '/tests/testfiles/contents/app/',
53 ... package = 'test', version = '1.0',
54 ... pretend = True)
55
56 And this one is for real:
57
58 - >>> b = Contents(here + '/tests/testfiles/contents/app/',
59 + b = Contents(here + '/tests/testfiles/contents/app/',
60 ... package = 'test', version = '1.0')
61
62 Pretend to add a file:
63
64 - >>> a.add('file', 'config-owned',
65 + a.add('file', 'config-owned',
66 ... destination = here + '/tests/testfiles/contents/app/',
67 ... path = '/test1', relative = True)
68 * pretending to add: file 1 config-owned "test1"
69
70 Lets not pretend this time:
71
72 - >>> b.add('file', 'config-owned',
73 + b.add('file', 'config-owned',
74 ... destination = here + '/tests/testfiles/contents/app/',
75 ... path = '/test1', relative = True)
76 - >>> b.entry(here + '/tests/testfiles/contents/app/test1') #doctest: +ELLIPSIS
77 + b.entry(here + '/tests/testfiles/contents/app/test1') #doctest: +ELLIPSIS
78 'file 1 config-owned "test1" ... d8e8fca2dc0f896fd7cb4cb0031ba249 '
79
80 Lets produce an error with a file that does not exist:
81
82 - >>> b.add('file', 'config-owned',
83 + b.add('file', 'config-owned',
84 ... destination = here + '/tests/testfiles/contents/app/',
85 ... path = '/nothere', relative = True) #doctest: +ELLIPSIS
86 * Cannot access file .../tests/testfiles/contents/app/nothere to add it as installation content. This should not happen!
87
88 Other file types:
89
90 - >>> b.add('hardlink', 'config-owned',
91 + b.add('hardlink', 'config-owned',
92 ... destination = here + '/tests/testfiles/contents/app/',
93 ... path = '/test2', relative = True)
94 - >>> b.entry(here + '/tests/testfiles/contents/app/test2') #doctest: +ELLIPSIS
95 + b.entry(here + '/tests/testfiles/contents/app/test2') #doctest: +ELLIPSIS
96 'file 1 config-owned "test2" ... d8e8fca2dc0f896fd7cb4cb0031ba249 '
97 - >>> b.add('dir', 'default-owned',
98 + b.add('dir', 'default-owned',
99 ... destination = here + '/tests/testfiles/contents/app/',
100 ... path = '/dir1', relative = True)
101 - >>> b.entry(here + '/tests/testfiles/contents/app/dir1') #doctest: +ELLIPSIS
102 + b.entry(here + '/tests/testfiles/contents/app/dir1') #doctest: +ELLIPSIS
103 'dir 1 default-owned "dir1" ... 0 '
104 - >>> b.add('dir', 'default-owned', destination = here + '/tests/testfiles/contents/app',
105 + b.add('dir', 'default-owned', destination = here + '/tests/testfiles/contents/app',
106 ... path = '/dir1',
107 ... relative = False)
108 - >>> b.entry(here + '/tests/testfiles/contents/app/dir1') #doctest: +ELLIPSIS
109 + b.entry(here + '/tests/testfiles/contents/app/dir1') #doctest: +ELLIPSIS
110 'dir 0 default-owned ".../tests/testfiles/contents/app/dir1" ... 0 '
111
112 Q: Is the full link to the target what we want?
113 A: Yes, since the link will still be ok even if we move the directory.
114
115 - >>> b.add('sym', 'virtual',
116 + b.add('sym', 'virtual',
117 ... destination = here + '/tests/testfiles/contents/app/',
118 ... path = '/test3', relative = True)
119 - >>> b.entry(here + '/tests/testfiles/contents/app/test3') #doctest: +ELLIPSIS
120 + b.entry(here + '/tests/testfiles/contents/app/test3') #doctest: +ELLIPSIS
121 'sym 1 virtual "test3" ... 0 .../tests/testfiles/contents/app/test1'
122
123 - >>> b.db_print() #doctest: +ELLIPSIS
124 + b.db_print() #doctest: +ELLIPSIS
125 file 1 config-owned "test1" ... d8e8fca2dc0f896fd7cb4cb0031ba249
126 file 1 config-owned "test2" ... d8e8fca2dc0f896fd7cb4cb0031ba249
127 sym 1 virtual "test3" ... 0 .../tests/testfiles/contents/app/test1
128 diff --git a/WebappConfig/ebuild.py b/WebappConfig/ebuild.py
129 index 03c0c57..cc23bec 100644
130 --- a/WebappConfig/ebuild.py
131 +++ b/WebappConfig/ebuild.py
132 @@ -201,35 +201,35 @@ class Ebuild:
133 The procedure from above is repeated to set up the default
134 environment:
135
136 - >>> import WebappConfig.config
137 - >>> config = WebappConfig.config.Config()
138 - >>> config.config.set('USER', 'my_htdocsbase', 'htdocs')
139 - >>> config.config.set('USER', 'pn', 'horde')
140 - >>> config.config.set('USER', 'pvr', '3.0.5')
141 - >>> import os.path
142 - >>> here = os.path.dirname(os.path.realpath(__file__))
143 - >>> config.config.set('USER', 'my_approot', here +
144 - ... '/tests/testfiles/share-webapps')
145 - >>> my_approot = config.config.get('USER', 'my_approot')
146 - >>> my_appdir = my_approot + "/horde/3.0.5"
147 - >>> config.config.set('USER', 'my_appdir', my_appdir)
148 - >>> config.config.set('USER', 'my_hookscriptsdir', my_appdir + '/hooks')
149 - >>> config.config.set('USER', 'my_cgibinbase', 'cgi-bin')
150 - >>> config.config.set('USER', 'my_errorsbase', 'error')
151 - >>> config.config.set('USER', 'my_iconsbase', 'icons')
152 - >>> config.config.set('USER', 'my_serverconfigdir', '/'.join([my_appdir,'conf']))
153 - >>> config.config.set('USER', 'my_hostrootdir', '/'.join([my_appdir,'hostroot']))
154 - >>> config.config.set('USER', 'my_htdocsdir', '/'.join([my_appdir,'htdocs']))
155 - >>> config.config.set('USER', 'my_sqlscriptsdir', '/'.join([my_appdir,'sqlscripts']))
156 + "">>> import WebappConfig.config"
157 + ">>> config = WebappConfig.config.Config()"
158 + ">>> config.config.set('USER', 'my_htdocsbase', 'htdocs')"
159 + ">>> config.config.set('USER', 'pn', 'horde')"
160 + ">>> config.config.set('USER', 'pvr', '3.0.5')"
161 + ">>> import os.path"
162 + ">>> here = os.path.dirname(os.path.realpath(__file__))"
163 + ">>> config.config.set('USER', 'my_approot', here +"
164 + "... '/tests/testfiles/share-webapps')"
165 + ">>> my_approot = config.config.get('USER', 'my_approot')"
166 + ">>> my_appdir = my_approot + "/horde/3.0.5""
167 + ">>> config.config.set('USER', 'my_appdir', my_appdir)"
168 + ">>> config.config.set('USER', 'my_hookscriptsdir', my_appdir + '/hooks')"
169 + ">>> config.config.set('USER', 'my_cgibinbase', 'cgi-bin')"
170 + ">>> config.config.set('USER', 'my_errorsbase', 'error')"
171 + ">>> config.config.set('USER', 'my_iconsbase', 'icons')"
172 + ">>> config.config.set('USER', 'my_serverconfigdir', '/'.join([my_appdir,'conf']))"
173 + ">>> config.config.set('USER', 'my_hostrootdir', '/'.join([my_appdir,'hostroot']))"
174 + ">>> config.config.set('USER', 'my_htdocsdir', '/'.join([my_appdir,'htdocs']))"
175 + ">>> config.config.set('USER', 'my_sqlscriptsdir', '/'.join([my_appdir,'sqlscripts']))"
176
177 Time to create the ebuild handler:
178
179 - >>> a = Ebuild(config)
180 + ">>> a = Ebuild(config)"
181
182 The dummy post-install file should display all the variables
183 that are exported here:
184
185 - >>> a.show_postinst() #doctest: +ELLIPSIS
186 + ">>> a.show_postinst() #doctest: +ELLIPSIS
187 <BLANKLINE>
188 =================================================================
189 POST-INSTALL INSTRUCTIONS
190 @@ -270,7 +270,7 @@ class Ebuild:
191 PVR: 3.0.5
192 <BLANKLINE>
193 =================================================================
194 - <BLANKLINE>
195 + <BLANKLINE>"
196 '''
197
198 v_root = self.get_config('vhost_root')
199 --
200 1.8.3.2