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: Building Bluecat on RH 8.0</title>
14 <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15 <link rel="prev" href="http://defaria.com/blogs/Status/archives/000328.html" title="Tagged HybridOS/Bluecat RH 8.0 building" />
16 <link rel="next" href="http://defaria.com/blogs/Status/archives/000330.html" title="Hybrid OS" />
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/000328.html">« Tagged HybridOS/Bluecat RH 8.0 building</a> |
42 <a href="http://defaria.com/blogs/Status/">Main</a>
43 | <a href="http://defaria.com/blogs/Status/archives/000330.html">Hybrid OS »</a>
47 <div class="entry" id="entry-329">
48 <h3 class="entry-header">Building Bluecat on RH 8.0</h3>
49 <div class="entry-content">
50 <div class="entry-body">
52 <li>Build local GNUTools on RH 8.0</li>
54 <li>Fixed bug in do_it script WRT RH 8.0</li>
57 <div id="more" class="entry-more">
58 <h3>Building GNUTools on RH 8.0</h3>
60 <p>When trying to build Bluecat on RH 8.0 and running mktools (to build the local gnutools) I get the following:</p>
62 <div class="code"><pre>
63 [int@europa make]$ autoreconf -f -i
64 autoreconf: `aclocal.m4' is updated
65 Makefile.am: installing `./depcomp'
66 WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
67 WARNING: and `config.h.top', to define templates for `config.h.in'
68 WARNING: is deprecated and discouraged.
70 WARNING: Using the third argument of `AC_DEFINE' and
71 WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
72 WARNING: `acconfig.h':
74 WARNING: AC_DEFINE([NEED_MAIN], 1,
75 WARNING: [Define if a function `main' is needed.])
77 WARNING: More sophisticated templates can also be produced, see the
78 WARNING: documentation.
79 autoheader-2.53: `config.h.in' is updated
82 <p>Further, after running configure I get the following odd file in /usr/local/bluecat/eng/bluecat/make/.deps: remote-$(REMOTE).Po which causes the make to fail:</p>
84 <div class="code"><pre>
85 [int@europa make]$ make
86 Makefile:329: .deps/remote-stub.Po: No such file or directory
87 make: *** No rule to make target `.deps/remote-stub.Po'. Stop.
90 <p>Renaming .deps/remote-$(REMOTE).Po -> .deps/remote-stub.Po allows the make to proceed.</p>
92 <h3>Fun with eval, echo and new shell</h3>
94 <p>One of the things that the Bluecat do_it script does is to define the series of "steps" that need to be performed in terms of command lines in variables. Later on the $BUILD_STEP is evaluated to determine which set of commands need to be done as follows:</p>
96 <div class="code"><pre>
97 echo "---- Step $BUILD_STEP started at `date` ----"
98 su $BUILD_CMD_OWNER -c "mkdir -p $LOGS_PREFIX/step${BUILD_STEP}"
99 cmd=`eval echo $"STEP${BUILD_STEP}_CMD"`
100 su $BUILD_CMD_OWNER -c "$cmd $*"
103 <p>Effectively the name of the environment variable holding the proper command(s) for the step is composed with the echo portion. The eval statement is used to "evaluate" that environment variable thus storing the string of commands into the environment variable cmd. This works well in past versions of the OS but it fails in RH 8.0. First here's the behavior on RH 6.1:</p>
105 <div class="code"><pre>
106 <font color="blue"><b>RH6.1:</b></font><u>export STEP1_CMD="ls /tmp"</u>
107 <font color="blue"><b>RH6.1:</b></font><u>export BUILD_STEP=1</u>
108 <font color="blue"><b>RH6.1:</b></font><u>echo $"STEP${BUILD_STEP}_CMD"</u>
112 <p>However hears the same commands on RH8.0:</p>
114 <div class="code"><pre>
115 <font color="red"><b>RH8.0:</b></font><u>export STEP1_CMD="ls /tmp"</u>
116 <font color="red"><b>RH8.0:</b></font><u>export BUILD_STEP=1</u>
117 <font color="red"><b>RH8.0:</b></font><u>echo $"STEP${BUILD_STEP}_CMD"</u>
121 <p>As you can see the result is missing a $. Prepending a leading \ before the $ fixes this. Adding in the eval portion also works:</p>
123 <div class="code"><pre>
124 <font color="red"><b>RH8.0:</b></font><u>eval echo \$"STEP${BUILD_STEP}_CMD"</u>
128 <p>However when this is assigned to another environment variable (i.e. cmd) the result is not correct:</p>
130 <div class="code"><pre>
131 <font color="red"><b>RH8.0:</b></font><u>cmd=`eval echo \$"STEP${BUILD_STEP}_CMD"`</u>
132 <font color="red"><b>RH8.0:</b></font><u>echo $cmd</u>
136 <p>Subsituting the syntax of $(<command>) for `<command` however does work:</p>
138 <div class="code"><pre>
139 <font color="red"><b>RH8.0:</b></font><u>cmd=$(eval echo \$"STEP${BUILD_STEP}_CMD")</u>
140 <font color="red"><b>RH8.0:</b></font><u>echo $cmd</u>
144 <p>Note that the shell (bash) has been majorly updated for RH8.0:</p>
146 <div class="code"><pre>
147 <font color="blue"><b>RH6.1:</b></font><u>bash -version</u>
148 GNU bash, version 1.14.7(1)
153 <div class="code"><pre>
154 <font color="red"><b>RH8.0:</b></font><u>bash -version</u>
155 GNU bash, version 2.05b.0(1)-release (i686-pc-linux-gnu)
156 Copyright (C) 2002 Free Software Foundation, Inc.
159 <p>Please note that this new syntax also works flawlessly on the older RH 6.1.</p>
162 <p class="entry-footer">
163 <span class="post-footers">Posted by on April 4, 2005 2:33 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000329.html">Permalink</a>