Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000590.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: UK -> GPDB</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000589.html" title="Convertdb" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000592.html" title="gpdb_add_project cronned" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000589.html">&laquo; Convertdb</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000592.html">gpdb_add_project cronned &raquo;</a>
44                      </p>
45
46                      <a id="a000590"></a>
47                      <div class="entry" id="entry-590">
48                         <h3 class="entry-header">UK -> GPDB</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <ul>
52   <li>Working on convertdb, a Perl script to read the UK database and convert it into GPDB</li>
53
54   <li>Finished code to convert users. Using de to get info about a user to populate the GPDB fields</li>
55
56   <li>Worked out problems with sites and got sites being added to GPDB from the UK database</li>
57
58   <li>Got adding of PDB_CLEARCASE records preliminarily done</li>
59 </ul>
60                            </div>
61                            <div id="more" class="entry-more">
62                               <h2>convertdb</h2>
63
64 <p>Started coding a Perl script to attempt to convert the UK database to GPDB. Got the Users done then worked out the Site records. The Projects are harder because they contain both site and project as a pair as well as vob/view information. The goal is to get as much of the conversion done as I can as well as flush out issues. Then, at some point, change mkview_linked and mkvob_db to use this new database.</p>
65
66 <p>Apparently mkview_linked and mkvob_db utilize this UK database mainly for the purposes of obtaining defaults or a template of information for the creation of views or vobs. There are site-wide defaults, project defaults and finally command line overrides.</p>
67
68 <h2>GPDB requirements for mkview_link and mkvob_db</h2>
69
70 <p>I scanned the scripts mkview_link and mkvob_db in order to determine what exactly it needs from GPDB. Here's what I found. Below field names are <b>bold</b> where table names are both <b>bold</b> and <i>italic</i>.</p>
71
72 <h3>mkview_linked</h3>
73 <ul>
74   <li>Obtains the <b>site</b> name in a table called <b><i>Sites</i> </b>where the <b>domain</b> field = the domain of the current host</li>
75
76   <li>Gets all of the <b>project</b> and <b>stream</b> for this <b>site</b></li>
77
78   <li>Obtains the following fields from a <b><i>Projects</i></b> table where the site = <b>site</b> and the <b>project</b> = "_default":</li>
79
80   <ul>
81     <li><b>site</b></li>
82
83     <li><b>project</b></li>
84
85     <li><b>vob_host</b></li>
86
87     <li><b>vob_path</b></li>
88
89     <li><b>vob_remote</b></li>
90
91     <li><b>pool_postfix</b></li>
92
93     <li><b>msdos_mode</b></li>
94
95     <li><b>snap_to</b></li>
96
97     <li><b>db_check</b></li>
98
99     <li><b>snap_notify</b></li>
100
101     <li><b>default_view</b></li>
102
103     <li><b>umask</b></li>
104
105     <li><b>group</b></li>
106
107     <li><b>view_host</b>: Used in -host for mkview</li>
108
109     <li><b>view_path</b>: Used in -hpath and -gpath for mkview  ($view_path/$username/$view.vws)</li>
110
111     <li><b>view_remote</b>: If present then the view storage is placed remotely. Note this is Unix specific.</li>
112
113     <li><b>msdos_view</b>: If present then a -tmode msdos style view is created.</li>
114
115     <li><b>config_spec</b>: Path to a file containing this project's default config spec that is then set as the new view's config spec<sup>1</sup></li>
116
117     <li><b>notify</b></li>
118
119     <li><b>vob_only</b></li>
120
121     <li><b>cachesize</b></li>
122
123     <li><b>snapshot</b></li>
124
125     <li><b>snapshot_workdir</b></li>
126
127     <li><b>stream</b></li>
128   </ul>
129
130   <li>It then obtains the same file list from a <b><i>Projects</i></b> table where the site = <b>site</b> and the <b>project</b> = the project name. The idea here is that _default is the base and the project record then overrides those defaults.</li>
131
132   <li>It then does some parameter substitutions for the field values above. Occurances of %USER% will be substituted with the current user, %PROJECT% the current project and strings of the form %SCRIPT()% will run the script defined between the (). The result of that will be the
133 substitution value.</p></li>
134 </ul>
135
136 <h4>Notes</h4>
137 <ol>
138   <li>Variable substitution happens on each config spec line too. Occurances of %USER% are replaced with the username (%LCUSER% a lower case username and %UCUSER% an upper case username), %VIEW% with the current view (similar %LCVIEW% and %UCVIEW%), %PROJECT% -&gt; current project and %SITE% -&gt; site (with LC/UC versions too).</li>
139 </ol>
140
141 <h3>mkvob_db</h3>
142 <ul>
143   <li>Obtains the <b>site</b> name in a table called <b><i>Sites</i> </b>where the <b>domain</b> field = the domain of the current host</li>
144
145   <li>Obtains all fields from the the <b><i>Projects</i> </b>table for this <b>site</b></li>
146
147   <li>Creates a $project_homes hash for each project/site combination with all fields from the <i><b>Projects</b></i> table</li>
148
149   <li>Creates a @valid_projects array for each project.</li>
150
151   <li>For each project, substitutes in to each field that is not defined from the site/project/_default record</li>
152
153   <li>Performs the same substitution as described above on the various fields.</li>
154 </ul>
155                            </div>
156                         </div>
157                         <p class="entry-footer">
158                            <span class="post-footers">Posted by  on November  7, 2006 12:29 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000590.html">Permalink</a>
159                         </p>
160                      </div>
161
162                      
163
164                      
165                   </div>
166                </div>
167             </div>
168          </div>
169       </div>
170    </div>
171 </body>
172 </html>