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">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Movable Type 5.2.3" />
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" />
12 <title>Status for Andrew DeFaria: UK -> GPDB</title>
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" />
22 <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
26 <div id="container-inner" class="pkg">
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>
36 <div id="pagebody-inner" class="pkg">
38 <div id="alpha-inner" class="pkg">
40 <p class="content-nav">
41 <a href="http://defaria.com/blogs/Status/archives/000589.html">« 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 »</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">
52 <li>Working on convertdb, a Perl script to read the UK database and convert it into GPDB</li>
54 <li>Finished code to convert users. Using de to get info about a user to populate the GPDB fields</li>
56 <li>Worked out problems with sites and got sites being added to GPDB from the UK database</li>
58 <li>Got adding of PDB_CLEARCASE records preliminarily done</li>
61 <div id="more" class="entry-more">
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>
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>
68 <h2>GPDB requirements for mkview_link and mkvob_db</h2>
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>
72 <h3>mkview_linked</h3>
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>
76 <li>Gets all of the <b>project</b> and <b>stream</b> for this <b>site</b></li>
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>
83 <li><b>project</b></li>
85 <li><b>vob_host</b></li>
87 <li><b>vob_path</b></li>
89 <li><b>vob_remote</b></li>
91 <li><b>pool_postfix</b></li>
93 <li><b>msdos_mode</b></li>
95 <li><b>snap_to</b></li>
97 <li><b>db_check</b></li>
99 <li><b>snap_notify</b></li>
101 <li><b>default_view</b></li>
103 <li><b>umask</b></li>
105 <li><b>group</b></li>
107 <li><b>view_host</b>: Used in -host for mkview</li>
109 <li><b>view_path</b>: Used in -hpath and -gpath for mkview ($view_path/$username/$view.vws)</li>
111 <li><b>view_remote</b>: If present then the view storage is placed remotely. Note this is Unix specific.</li>
113 <li><b>msdos_view</b>: If present then a -tmode msdos style view is created.</li>
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>
117 <li><b>notify</b></li>
119 <li><b>vob_only</b></li>
121 <li><b>cachesize</b></li>
123 <li><b>snapshot</b></li>
125 <li><b>snapshot_workdir</b></li>
127 <li><b>stream</b></li>
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>
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>
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% -> current project and %SITE% -> site (with LC/UC versions too).</li>
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>
145 <li>Obtains all fields from the the <b><i>Projects</i> </b>table for this <b>site</b></li>
147 <li>Creates a $project_homes hash for each project/site combination with all fields from the <i><b>Projects</b></i> table</li>
149 <li>Creates a @valid_projects array for each project.</li>
151 <li>For each project, substitutes in to each field that is not defined from the site/project/_default record</li>
153 <li>Performs the same substitution as described above on the various fields.</li>
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>