<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rpm: build.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">rpm
 <span id="projectnumber">4.8.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">build.c</div> </div>
</div><!--header-->
<div class="contents">
<a href="build_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include "<a class="code" href="system_8h.html">system.h</a>"</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> </div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <libgen.h></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> </div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include <rpm/rpmcli.h></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <rpm/rpmtag.h></span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include <rpm/rpmlib.h></span> <span class="comment">/* rpmrc, MACHTABLE .. */</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <rpm/rpmbuild.h></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include <rpm/rpmps.h></span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include <rpm/rpmte.h></span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <rpm/rpmts.h></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <rpm/rpmfileutil.h></span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <rpm/rpmlog.h></span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <lib/misc.h></span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="build_8h.html">build.h</a>"</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "<a class="code" href="debug_8h.html">debug.h</a>"</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="build_8c.html#a440e27826f1e88ca3a9b87e9c0c70423"> 26</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="build_8c.html#a440e27826f1e88ca3a9b87e9c0c70423">checkSpec</a>(<a class="code" href="rpmtypes_8h.html#a1a512138316a227059ca128597dbd464">rpmts</a> ts, <a class="code" href="rpmtypes_8h.html#acb1ffe4e2d96b8277f9f46ecc0c7b8a6">Header</a> h)</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> {</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <a class="code" href="rpmps_8h.html#a7ec28162fa78467d0beca8d76ec183eb">rpmps</a> ps;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="keywordtype">int</span> rc;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keywordflow">if</span> (!<a class="code" href="header_8h.html#aa2c9e0264839533d7b7061a347b82f9f">headerIsEntry</a>(h, <a class="code" href="rpmtag_8h.html#a342756dddb61d125ae851a8b1ab0507ba95466e6949826b1a95ad79a39bb3a014">RPMTAG_REQUIRENAME</a>)</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  && !<a class="code" href="header_8h.html#aa2c9e0264839533d7b7061a347b82f9f">headerIsEntry</a>(h, <a class="code" href="rpmtag_8h.html#a342756dddb61d125ae851a8b1ab0507ba15ea96c2b33c9c73b9ee3e2157e54273">RPMTAG_CONFLICTNAME</a>))</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  rc = <a class="code" href="rpmts_8h.html#a14f855b79d0aff83c084e254e2442006">rpmtsAddInstallElement</a>(ts, h, NULL, 0, NULL);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  rc = <a class="code" href="rpmts_8h.html#aeb564de4ae14b941c0eb37156c77e7df">rpmtsCheck</a>(ts);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  ps = <a class="code" href="rpmts_8h.html#a2b23bab4be67f04a60ce463d4acfd63c">rpmtsProblems</a>(ts);</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">if</span> (rc == 0 && <a class="code" href="rpmps_8h.html#ada7b50cc5ccf1a7f6a05c46330fee3af">rpmpsNumProblems</a>(ps) > 0) {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>, <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"Failed build dependencies:\n"</span>));</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <a class="code" href="rpmps_8h.html#a00bdb06c5d581722ea2dee81ffba3e08">rpmpsPrint</a>(NULL, ps);</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  rc = 1;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  }</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  ps = <a class="code" href="rpmps_8h.html#a3a181ab1707f03e032005f3ac442c813">rpmpsFree</a>(ps);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="comment">/* XXX nuke the added package. */</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="rpmts_8h.html#ad3104a1a8c915cde09f2101a16f78133">rpmtsClean</a>(ts);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">return</span> rc;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="build_8c.html#ae06c9263ced0a607feb69fd395368e0f"> 55</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="build_8c.html#ae06c9263ced0a607feb69fd395368e0f">isSpecFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * specfile)</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordtype">char</span> buf[256];</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> * s;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  FILE * f;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordtype">int</span> count;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordtype">int</span> checking;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  f = fopen(specfile, <span class="stringliteral">"r"</span>);</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">if</span> (f == NULL || ferror(f)) {</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>, <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"Unable to open spec file %s: %s\n"</span>),</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  specfile, strerror(<a class="code" href="system_8h.html#ad65a8842cc674e3ddf69355898c0ecbf">errno</a>));</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  }</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  count = fread(buf, <span class="keyword">sizeof</span>(buf[0]), <span class="keyword">sizeof</span>(buf), f);</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  (void) fclose(f);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">if</span> (count == 0)</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  checking = 1;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordflow">for</span> (s = buf; count--; s++) {</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">switch</span> (*s) {</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keywordflow">case</span> <span class="charliteral">'\r'</span>:</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">case</span> <span class="charliteral">'\n'</span>:</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  checking = 1;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keywordflow">case</span> <span class="charliteral">':'</span>:</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  checking = 0;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="preprocessor">#if 0</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">if</span> (checking && !(isprint(*s) || isspace(*s))) <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">if</span> (checking && !(isprint(*s) || isspace(*s)) && *(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)s < 32) <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  }</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> }</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment">/* </span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> * Try to find a spec from a tarball pointed to by arg. </span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment"> * Return absolute path to spec name on success, otherwise NULL.</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment"> */</span></div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="build_8c.html#ab46ac4b5dfbd442e396fe3fb4931e2a0"> 102</a></span> <span class="keyword">static</span> <span class="keywordtype">char</span> * <a class="code" href="build_8c.html#ab46ac4b5dfbd442e396fe3fb4931e2a0">getTarSpec</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *arg)</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordtype">char</span> *specFile = NULL;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordtype">char</span> *specDir;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordtype">char</span> *specBase;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordtype">char</span> *tmpSpecFile;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **<span class="keywordflow">try</span>;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordtype">char</span> tarbuf[BUFSIZ];</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordtype">int</span> gotspec = 0, res;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *tryspec[] = { <span class="stringliteral">"Specfile"</span>, <span class="stringliteral">"\\*.spec"</span>, NULL };</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  specDir = <a class="code" href="rpmfileutil_8h.html#a082c9f1c3b1e4fef327ac91a87ca51e9">rpmGetPath</a>(<span class="stringliteral">"%{_specdir}"</span>, NULL);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  tmpSpecFile = <a class="code" href="rpmfileutil_8h.html#a082c9f1c3b1e4fef327ac91a87ca51e9">rpmGetPath</a>(<span class="stringliteral">"%{_specdir}/"</span>, <span class="stringliteral">"rpm-spec.XXXXXX"</span>, NULL);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  (void) close(mkstemp(tmpSpecFile));</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">for</span> (<span class="keywordflow">try</span> = tryspec; *<span class="keywordflow">try</span> != NULL; <span class="keywordflow">try</span>++) {</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  FILE *fp;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordtype">char</span> *cmd;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  cmd = <a class="code" href="rpmmacro_8h.html#a39b56d7237065eaa71f253a6c2dbcfea">rpmExpand</a>(<span class="stringliteral">"%{uncompress: "</span>, arg, <span class="stringliteral">"} | "</span>,</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="stringliteral">"%{__tar} xOvf - --wildcards "</span>, *<span class="keywordflow">try</span>,</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="stringliteral">" 2>&1 > "</span>, tmpSpecFile, NULL);</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">if</span> (!(fp = popen(cmd, <span class="stringliteral">"r"</span>))) {</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>, <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"Failed to open tar pipe: %m\n"</span>));</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordtype">char</span> *fok;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">for</span> (;;) {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  fok = fgets(tarbuf, <span class="keyword">sizeof</span>(tarbuf) - 1, fp);</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="comment">/* tar sometimes prints "tar: Record size = 16" messages */</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keywordflow">if</span> (!fok || strncmp(fok, <span class="stringliteral">"tar: "</span>, 5) != 0)</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  }</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  pclose(fp);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  gotspec = (fok != NULL) && <a class="code" href="build_8c.html#ae06c9263ced0a607feb69fd395368e0f">isSpecFile</a>(tmpSpecFile);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> </div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordflow">if</span> (!gotspec) </div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  unlink(tmpSpecFile);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  free(cmd);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  }</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">if</span> (!gotspec) {</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>, <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"Failed to read spec file from %s\n"</span>), arg);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  }</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  specBase = basename(tarbuf);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="comment">/* remove trailing \n */</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  specBase[strlen(specBase)-1] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span> </div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <a class="code" href="rpmstring_8h.html#aef54821b6f5090df66cb7e99e1e8e3c8">rasprintf</a>(&specFile, <span class="stringliteral">"%s/%s"</span>, specDir, specBase);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  res = rename(tmpSpecFile, specFile);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> </div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">if</span> (res) {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>, <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"Failed to rename %s to %s: %m\n"</span>),</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  tmpSpecFile, specFile);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  free(specFile);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  specFile = NULL;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">/* mkstemp() can give unnecessarily strict permissions, fixup */</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  mode_t mask;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  umask(mask = umask(0));</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  (void) chmod(specFile, 0666 & ~mask);</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  }</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> </div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> exit:</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  (void) unlink(tmpSpecFile);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  free(tmpSpecFile);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  free(specDir);</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordflow">return</span> specFile;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> }</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="build_8c.html#a988051b70a508914e1d332496e62e044"> 178</a></span> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="build_8c.html#a988051b70a508914e1d332496e62e044">buildForTarget</a>(<a class="code" href="rpmtypes_8h.html#a1a512138316a227059ca128597dbd464">rpmts</a> ts, <span class="keyword">const</span> <span class="keywordtype">char</span> * arg, <a class="code" href="structrpmBuildArguments__s.html">BTA_t</a> ba)</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> {</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> * passPhrase = ba-><a class="code" href="structrpmBuildArguments__s.html#aa62b9b462381a0048ea45f9abef6bb56">passPhrase</a>;</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> * cookie = ba-><a class="code" href="structrpmBuildArguments__s.html#ab4df0b8e1a35e866a52d82c2cb75c404">cookie</a>;</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordtype">int</span> buildAmount = ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a>;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordtype">char</span> * buildRootURL = NULL;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordtype">char</span> * specFile = NULL;</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <a class="code" href="structrpmSpec__s.html">rpmSpec</a> spec = NULL;</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordtype">int</span> rc = 1; <span class="comment">/* assume failure */</span></div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span> <span class="preprocessor">#ifndef DYING</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <a class="code" href="rpmlib_8h.html#a9c78c502742acadd9f14af15de12fbfe">rpmSetTables</a>(<a class="code" href="rpmlib_8h.html#a41a8861e7ff5c8d189305d9ff1319beeacdba72b619ac562066bdcdf99d48f8bf">RPM_MACHTABLE_BUILDARCH</a>, <a class="code" href="rpmlib_8h.html#a41a8861e7ff5c8d189305d9ff1319beea7bde99e086950473dacf51b10e974ef1">RPM_MACHTABLE_BUILDOS</a>);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">if</span> (ba-><a class="code" href="structrpmBuildArguments__s.html#ad4c11c26f63a02a2f333c4d8bd4ebcc5">buildRootOverride</a>)</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  buildRootURL = <a class="code" href="rpmfileutil_8h.html#aa32585dcb214b5099ad0ea3d4044221b">rpmGenPath</a>(NULL, ba-><a class="code" href="structrpmBuildArguments__s.html#ad4c11c26f63a02a2f333c4d8bd4ebcc5">buildRootOverride</a>, NULL);</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span> </div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="comment">/* Create build tree if necessary */</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> * buildtree = <span class="stringliteral">"%{_topdir}:%{_specdir}:%{_sourcedir}:%{_builddir}:%{_rpmdir}:%{_srcrpmdir}:%{_buildrootdir}"</span>;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> * rootdir = <a class="code" href="rpmts_8h.html#adf9c9eb5ddc9ec497575bfc0335ace15">rpmtsRootDir</a>(ts);</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">if</span> (<a class="code" href="rpmfileutil_8h.html#ae3a5064720ea1f5929f4f1b059d8a80c">rpmMkdirs</a>(!<a class="code" href="rpmstring_8h.html#a1e5f8ebc49cc189053eb455e500d7e00">rstreq</a>(rootdir, <span class="stringliteral">"/"</span>) ? rootdir : NULL , buildtree)) {</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  }</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> </div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordflow">if</span> (ba-><a class="code" href="structrpmBuildArguments__s.html#a8d974c0d210be9e09d0b356bc5ec878f">buildMode</a> == <span class="charliteral">'t'</span>) {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordtype">char</span> *srcdir = NULL, *dir;</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> </div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  specFile = <a class="code" href="build_8c.html#ab46ac4b5dfbd442e396fe3fb4931e2a0">getTarSpec</a>(arg);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">if</span> (!specFile)</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> </div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="comment">/* Make the directory of the tarball %_sourcedir for this run */</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="comment">/* dirname() may modify contents so extra hoops needed. */</span></div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordflow">if</span> (*arg != <span class="charliteral">'/'</span>) {</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  dir = <a class="code" href="rpmfileutil_8h.html#ac50a8e532768e8bbad7c5f3d25fbecbd">rpmGetCwd</a>();</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <a class="code" href="rpmstring_8h.html#ae110db3befa40c8fcd2a15f61786b88b">rstrscat</a>(&dir, <span class="stringliteral">"/"</span>, arg, NULL);</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  dir = <a class="code" href="system_8h.html#ab62344482c6d93843e0388d2ba2cf514">xstrdup</a>(arg);</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  }</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  srcdir = dirname(dir);</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <a class="code" href="rpmmacro_8h.html#aa4e9d6d8d215046ee21acb156c659efe">addMacro</a>(NULL, <span class="stringliteral">"_sourcedir"</span>, NULL, srcdir, <a class="code" href="rpmmacro_8h.html#a6b8871ea4414512f9d8d35638eb9d683">RMIL_TARBALL</a>);</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  free(dir);</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  specFile = <a class="code" href="system_8h.html#ab62344482c6d93843e0388d2ba2cf514">xstrdup</a>(arg);</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  }</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">if</span> (*specFile != <span class="charliteral">'/'</span>) {</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordtype">char</span> *cwd = <a class="code" href="rpmfileutil_8h.html#ac50a8e532768e8bbad7c5f3d25fbecbd">rpmGetCwd</a>();</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordtype">char</span> *s = NULL;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <a class="code" href="rpmstring_8h.html#aef54821b6f5090df66cb7e99e1e8e3c8">rasprintf</a>(&s, <span class="stringliteral">"%s/%s"</span>, cwd, arg);</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  free(cwd);</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  free(specFile);</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  specFile = s;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  }</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span> </div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keyword">struct </span>stat st;</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">if</span> (stat(specFile, &st) < 0) {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>, <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"failed to stat %s: %m\n"</span>), specFile);</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  }</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keywordflow">if</span> (! S_ISREG(st.st_mode)) {</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>, <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"File %s is not a regular file.\n"</span>), specFile);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span> </div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="comment">/* Try to verify that the file is actually a specfile */</span></div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">if</span> (!<a class="code" href="build_8c.html#ae06c9263ced0a607feb69fd395368e0f">isSpecFile</a>(specFile)) {</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <a class="code" href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a>(<a class="code" href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a>,</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"File %s does not appear to be a specfile.\n"</span>), specFile);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  }</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  </div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  <span class="comment">/* Don't parse spec if only its removal is requested */</span></div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keywordflow">if</span> (ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a> == <a class="code" href="rpmbuild_8h.html#a23067366f7d82aa059f41658099fda93a7e26df39cdf47fbfe2a1c5069decf033">RPMBUILD_RMSPEC</a>) {</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  rc = unlink(specFile);</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  }</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span> </div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="comment">/* Parse the spec file */</span></div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> <span class="preprocessor">#define _anyarch(_f) \</span></div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> <span class="preprocessor">(((_f)&(RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL|RPMBUILD_PACKAGEBINARY)) == 0)</span></div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keywordflow">if</span> (<a class="code" href="rpmbuild_8h.html#a56362ef9a648c99f079747bffb05fa76">parseSpec</a>(ts, specFile, ba-><a class="code" href="structrpmBuildArguments__s.html#a4f0e2aefc1295a794cafdebfcede23f9">rootdir</a>, buildRootURL, 0, passPhrase,</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  cookie, <a class="code" href="build_8c.html#ad3df6f61106f5e78d7c684e85e10d397">_anyarch</a>(buildAmount), ba-><a class="code" href="structrpmBuildArguments__s.html#ac6b5abc7094bf89fc334587eca74679c">force</a>))</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  {</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  }</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span> <span class="preprocessor">#undef _anyarch</span></div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <span class="keywordflow">if</span> ((spec = <a class="code" href="rpmts_8h.html#a3826c79a58fcf7b734e73fe2b867b900">rpmtsSetSpec</a>(ts, NULL)) == NULL) {</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  }</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span> </div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordflow">if</span> ( ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a>&<a class="code" href="rpmbuild_8h.html#a23067366f7d82aa059f41658099fda93a473063df8b824255634653ba80a437f2">RPMBUILD_RMSOURCE</a> && !(ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a>&~(<a class="code" href="rpmbuild_8h.html#a23067366f7d82aa059f41658099fda93a473063df8b824255634653ba80a437f2">RPMBUILD_RMSOURCE</a>|<a class="code" href="rpmbuild_8h.html#a23067366f7d82aa059f41658099fda93a7e26df39cdf47fbfe2a1c5069decf033">RPMBUILD_RMSPEC</a>)) ) {</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  rc = <a class="code" href="rpmbuild_8h.html#ae07aa303fd6a2ab959bb11a44f7173f9">doRmSource</a>(spec);</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">if</span> ( rc == <a class="code" href="rpmtypes_8h.html#aa30b10f32f3a5e820ec05d099993e801ab6a502fb02cfd2c16380fa6ac52902d4">RPMRC_OK</a> && ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a>&<a class="code" href="rpmbuild_8h.html#a23067366f7d82aa059f41658099fda93a7e26df39cdf47fbfe2a1c5069decf033">RPMBUILD_RMSPEC</a> )</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  rc = unlink(specFile);</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  }</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span> </div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="comment">/* Assemble source header from parsed components */</span></div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <a class="code" href="rpmbuild_8h.html#a07c49a8e6dec281b163e3cafb40625b6">initSourceHeader</a>(spec);</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span> </div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="comment">/* Check build prerequisites */</span></div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">if</span> (!ba-><a class="code" href="structrpmBuildArguments__s.html#a5d5b3e5d757c7876959b0837a47122e2">noDeps</a> && <a class="code" href="build_8c.html#a440e27826f1e88ca3a9b87e9c0c70423">checkSpec</a>(ts, spec-><a class="code" href="structrpmSpec__s.html#a6aa77decfc01f812ea439ca8e7cf9ab6">sourceHeader</a>)) {</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  }</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keywordflow">if</span> (<a class="code" href="rpmbuild_8h.html#aabdc53625b4f47c7fac629bf59ac1eee">buildSpec</a>(ts, spec, buildAmount, ba-><a class="code" href="structrpmBuildArguments__s.html#a38aaf833779182e8ad834031c5fbd660">noBuild</a>)) {</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  }</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  </div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <span class="keywordflow">if</span> (ba-><a class="code" href="structrpmBuildArguments__s.html#a8d974c0d210be9e09d0b356bc5ec878f">buildMode</a> == <span class="charliteral">'t'</span>)</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  (void) unlink(specFile);</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  rc = 0;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span> </div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> exit:</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  free(specFile);</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <a class="code" href="rpmspec_8h.html#a355d23711761ca81710ff75930b930ed">freeSpec</a>(spec);</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  free(buildRootURL);</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="keywordflow">return</span> rc;</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> }</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span> </div><div class="line"><a name="l00299"></a><span class="lineno"><a class="line" href="build_8h.html#a49fb57808aeb61294615883d96e1f495"> 299</a></span> <span class="keywordtype">int</span> <a class="code" href="build_8c.html#a49fb57808aeb61294615883d96e1f495">build</a>(<a class="code" href="rpmtypes_8h.html#a1a512138316a227059ca128597dbd464">rpmts</a> ts, <span class="keyword">const</span> <span class="keywordtype">char</span> * arg, <a class="code" href="structrpmBuildArguments__s.html">BTA_t</a> ba, <span class="keyword">const</span> <span class="keywordtype">char</span> * rcfile)</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span> {</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keywordtype">char</span> *t, *te;</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keywordtype">int</span> rc = 0;</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="keywordtype">char</span> * targets = ba-><a class="code" href="structrpmBuildArguments__s.html#a08409409211f35ab0855b369d9ba729c">targets</a>;</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> <span class="preprocessor">#define buildCleanMask (RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)</span></div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="keywordtype">int</span> cleanFlags = ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a> & <a class="code" href="build_8c.html#a38911a608489859eee12344e79e85211">buildCleanMask</a>;</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <a class="code" href="rpmts_8h.html#aa9db567bc7c49d7d84ac7fc178543348">rpmVSFlags</a> vsflags, ovsflags;</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> </div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  vsflags = <a class="code" href="rpmmacro_8h.html#a4bb017f52f3bd9b8aae77772b0bc9ba8">rpmExpandNumeric</a>(<span class="stringliteral">"%{_vsflags_build}"</span>);</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <span class="keywordflow">if</span> (ba-><a class="code" href="structrpmBuildArguments__s.html#a8d427e31d6292eb83e727d18b6c580a8">qva_flags</a> & <a class="code" href="rpmvf_8h.html#a88edb36096996aa24e1fc3385cb2140aa8ebdf945fb2e42959951139d82cb3735">VERIFY_DIGEST</a>)</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  vsflags |= <a class="code" href="rpmts_8h.html#aeece22238af582ac0a41afdafa77df77">_RPMVSF_NODIGESTS</a>;</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordflow">if</span> (ba-><a class="code" href="structrpmBuildArguments__s.html#a8d427e31d6292eb83e727d18b6c580a8">qva_flags</a> & <a class="code" href="rpmvf_8h.html#a88edb36096996aa24e1fc3385cb2140aabe476139b5651dcbb51706ba8608a51b">VERIFY_SIGNATURE</a>)</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  vsflags |= <a class="code" href="rpmts_8h.html#a7515813532c9d4ead6bfd4b51860078f">_RPMVSF_NOSIGNATURES</a>;</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <span class="keywordflow">if</span> (ba-><a class="code" href="structrpmBuildArguments__s.html#a8d427e31d6292eb83e727d18b6c580a8">qva_flags</a> & <a class="code" href="rpmvf_8h.html#a88edb36096996aa24e1fc3385cb2140aa8456599dc01840d5c9a758ebd6bd756c">VERIFY_HDRCHK</a>)</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  vsflags |= <a class="code" href="rpmts_8h.html#a081c96e55d490b5e99505eda7e93602daaa6d0b979fd5881394e98f2912cff11f">RPMVSF_NOHDRCHK</a>;</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  ovsflags = <a class="code" href="rpmts_8h.html#a586c60d8364e263aa5e22736cbac1e69">rpmtsSetVSFlags</a>(ts, vsflags);</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span> </div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="keywordflow">if</span> (targets == NULL) {</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  rc = <a class="code" href="build_8c.html#a988051b70a508914e1d332496e62e044">buildForTarget</a>(ts, arg, ba);</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordflow">goto</span> exit;</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  }</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span> </div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <span class="comment">/* parse up the build operators */</span></div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  printf(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"Building target platforms: %s\n"</span>), targets);</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span> </div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a> &= ~<a class="code" href="build_8c.html#a38911a608489859eee12344e79e85211">buildCleanMask</a>;</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <span class="keywordflow">for</span> (t = targets; *t != <span class="charliteral">'\0'</span>; t = te) {</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="keywordtype">char</span> *target;</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keywordflow">if</span> ((te = strchr(t, <span class="charliteral">','</span>)) == NULL)</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  te = t + strlen(t);</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  target = <a class="code" href="system_8h.html#a4213b2ad4e4e16d946a377f6684fb364">xmalloc</a>(te-t+1);</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  strncpy(target, t, (te-t));</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  target[te-t] = <span class="charliteral">'\0'</span>;</div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <span class="keywordflow">if</span> (*te != <span class="charliteral">'\0'</span>)</div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  te++;</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <span class="keywordflow">else</span> <span class="comment">/* XXX Perform clean-up after last target build. */</span></div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  ba-><a class="code" href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">buildAmount</a> |= cleanFlags;</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span> </div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  printf(<a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a>(<span class="stringliteral">"Building for target %s\n"</span>), target);</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="comment">/* Read in configuration for target. */</span></div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <a class="code" href="rpmmacro_8h.html#a1a83ba3c147a4005c80485cc2161bf3b">rpmFreeMacros</a>(NULL);</div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <a class="code" href="rpmlib_8h.html#afa5accc1656e25a42e1dbe247405ebe0">rpmFreeRpmrc</a>();</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  (void) <a class="code" href="rpmlib_8h.html#aac91e0fc109eedd29b5aebed135b8580">rpmReadConfigFiles</a>(rcfile, target);</div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  free(target);</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  rc = <a class="code" href="build_8c.html#a988051b70a508914e1d332496e62e044">buildForTarget</a>(ts, arg, ba);</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <span class="keywordflow">if</span> (rc)</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  }</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span> </div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span> exit:</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  vsflags = <a class="code" href="rpmts_8h.html#a586c60d8364e263aa5e22736cbac1e69">rpmtsSetVSFlags</a>(ts, ovsflags);</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="comment">/* Restore original configuration. */</span></div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <a class="code" href="rpmmacro_8h.html#a1a83ba3c147a4005c80485cc2161bf3b">rpmFreeMacros</a>(NULL);</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  <a class="code" href="rpmlib_8h.html#afa5accc1656e25a42e1dbe247405ebe0">rpmFreeRpmrc</a>();</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  (void) <a class="code" href="rpmlib_8h.html#aac91e0fc109eedd29b5aebed135b8580">rpmReadConfigFiles</a>(rcfile, NULL);</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span> </div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  <span class="keywordflow">return</span> rc;</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span> }</div><div class="ttc" id="build_8c_html_a38911a608489859eee12344e79e85211"><div class="ttname"><a href="build_8c.html#a38911a608489859eee12344e79e85211">buildCleanMask</a></div><div class="ttdeci">#define buildCleanMask</div></div>
<div class="ttc" id="header_8h_html_aa2c9e0264839533d7b7061a347b82f9f"><div class="ttname"><a href="header_8h.html#aa2c9e0264839533d7b7061a347b82f9f">headerIsEntry</a></div><div class="ttdeci">int headerIsEntry(Header h, rpmTag tag)</div><div class="ttdoc">Check if tag is in header. </div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_ae811dc01a775a2b154349be6b00c085f"><div class="ttname"><a href="structrpmBuildArguments__s.html#ae811dc01a775a2b154349be6b00c085f">rpmBuildArguments_s::buildAmount</a></div><div class="ttdeci">int buildAmount</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00317">rpmcli.h:317</a></div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_a5d5b3e5d757c7876959b0837a47122e2"><div class="ttname"><a href="structrpmBuildArguments__s.html#a5d5b3e5d757c7876959b0837a47122e2">rpmBuildArguments_s::noDeps</a></div><div class="ttdeci">int noDeps</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00324">rpmcli.h:324</a></div></div>
<div class="ttc" id="system_8h_html_a4213b2ad4e4e16d946a377f6684fb364"><div class="ttname"><a href="system_8h.html#a4213b2ad4e4e16d946a377f6684fb364">xmalloc</a></div><div class="ttdeci">#define xmalloc(_size)</div><div class="ttdef"><b>Definition:</b> <a href="system_8h_source.html#l00244">system.h:244</a></div></div>
<div class="ttc" id="build_8c_html_ae06c9263ced0a607feb69fd395368e0f"><div class="ttname"><a href="build_8c.html#ae06c9263ced0a607feb69fd395368e0f">isSpecFile</a></div><div class="ttdeci">static int isSpecFile(const char *specfile)</div><div class="ttdef"><b>Definition:</b> <a href="build_8c_source.html#l00055">build.c:55</a></div></div>
<div class="ttc" id="rpmts_8h_html_aeb564de4ae14b941c0eb37156c77e7df"><div class="ttname"><a href="rpmts_8h.html#aeb564de4ae14b941c0eb37156c77e7df">rpmtsCheck</a></div><div class="ttdeci">int rpmtsCheck(rpmts ts)</div><div class="ttdoc">Perform dependency resolution on the transaction set. </div></div>
<div class="ttc" id="build_8c_html_a49fb57808aeb61294615883d96e1f495"><div class="ttname"><a href="build_8c.html#a49fb57808aeb61294615883d96e1f495">build</a></div><div class="ttdeci">int build(rpmts ts, const char *arg, BTA_t ba, const char *rcfile)</div><div class="ttdef"><b>Definition:</b> <a href="build_8c_source.html#l00299">build.c:299</a></div></div>
<div class="ttc" id="build_8c_html_a988051b70a508914e1d332496e62e044"><div class="ttname"><a href="build_8c.html#a988051b70a508914e1d332496e62e044">buildForTarget</a></div><div class="ttdeci">static int buildForTarget(rpmts ts, const char *arg, BTA_t ba)</div><div class="ttdef"><b>Definition:</b> <a href="build_8c_source.html#l00178">build.c:178</a></div></div>
<div class="ttc" id="debug_8h_html"><div class="ttname"><a href="debug_8h.html">debug.h</a></div></div>
<div class="ttc" id="rpmts_8h_html_a2b23bab4be67f04a60ce463d4acfd63c"><div class="ttname"><a href="rpmts_8h.html#a2b23bab4be67f04a60ce463d4acfd63c">rpmtsProblems</a></div><div class="ttdeci">rpmps rpmtsProblems(rpmts ts)</div><div class="ttdoc">Return current transaction set problems. </div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_a38aaf833779182e8ad834031c5fbd660"><div class="ttname"><a href="structrpmBuildArguments__s.html#a38aaf833779182e8ad834031c5fbd660">rpmBuildArguments_s::noBuild</a></div><div class="ttdeci">int noBuild</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00323">rpmcli.h:323</a></div></div>
<div class="ttc" id="rpmstring_8h_html_ae110db3befa40c8fcd2a15f61786b88b"><div class="ttname"><a href="rpmstring_8h.html#ae110db3befa40c8fcd2a15f61786b88b">rstrscat</a></div><div class="ttdeci">char * rstrscat(char **dest, const char *arg,...) RPM_GNUC_NULL_TERMINATED</div><div class="ttdoc">Concatenate multiple strings with dynamically (re)allocated memory. </div></div>
<div class="ttc" id="rpmlib_8h_html_a41a8861e7ff5c8d189305d9ff1319beea7bde99e086950473dacf51b10e974ef1"><div class="ttname"><a href="rpmlib_8h.html#a41a8861e7ff5c8d189305d9ff1319beea7bde99e086950473dacf51b10e974ef1">RPM_MACHTABLE_BUILDOS</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmlib_8h_source.html#l00066">rpmlib.h:66</a></div></div>
<div class="ttc" id="rpmps_8h_html_a7ec28162fa78467d0beca8d76ec183eb"><div class="ttname"><a href="rpmps_8h.html#a7ec28162fa78467d0beca8d76ec183eb">rpmps</a></div><div class="ttdeci">struct rpmps_s * rpmps</div><div class="ttdoc">Transaction problems found while processing a transaction set/. </div><div class="ttdef"><b>Definition:</b> <a href="rpmps_8h_source.html#l00042">rpmps.h:42</a></div></div>
<div class="ttc" id="rpmts_8h_html_adf9c9eb5ddc9ec497575bfc0335ace15"><div class="ttname"><a href="rpmts_8h.html#adf9c9eb5ddc9ec497575bfc0335ace15">rpmtsRootDir</a></div><div class="ttdeci">const char * rpmtsRootDir(rpmts ts)</div><div class="ttdoc">Get transaction rootDir, i.e. </div></div>
<div class="ttc" id="rpmlog_8h_html_acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d"><div class="ttname"><a href="rpmlog_8h.html#acd0c489c508a24a73b39565aaa2658c3a29cea4e65e8a30e907609e83187b439d">RPMLOG_ERR</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmlog_8h_source.html#l00033">rpmlog.h:33</a></div></div>
<div class="ttc" id="system_8h_html_a8a97de23397d8af6821824c0234d8c3c"><div class="ttname"><a href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">_</a></div><div class="ttdeci">#define _(Text)</div><div class="ttdef"><b>Definition:</b> <a href="system_8h_source.html#l00291">system.h:291</a></div></div>
<div class="ttc" id="rpmbuild_8h_html_a07c49a8e6dec281b163e3cafb40625b6"><div class="ttname"><a href="rpmbuild_8h.html#a07c49a8e6dec281b163e3cafb40625b6">initSourceHeader</a></div><div class="ttdeci">void initSourceHeader(rpmSpec spec)</div><div class="ttdoc">Create and initialize header for source package. </div></div>
<div class="ttc" id="rpmlib_8h_html_aac91e0fc109eedd29b5aebed135b8580"><div class="ttname"><a href="rpmlib_8h.html#aac91e0fc109eedd29b5aebed135b8580">rpmReadConfigFiles</a></div><div class="ttdeci">int rpmReadConfigFiles(const char *file, const char *target)</div><div class="ttdoc">Read macro configuration file(s) for a target. </div></div>
<div class="ttc" id="rpmtag_8h_html_a342756dddb61d125ae851a8b1ab0507ba15ea96c2b33c9c73b9ee3e2157e54273"><div class="ttname"><a href="rpmtag_8h.html#a342756dddb61d125ae851a8b1ab0507ba15ea96c2b33c9c73b9ee3e2157e54273">RPMTAG_CONFLICTNAME</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmtag_8h_source.html#l00134">rpmtag.h:134</a></div></div>
<div class="ttc" id="rpmbuild_8h_html_a56362ef9a648c99f079747bffb05fa76"><div class="ttname"><a href="rpmbuild_8h.html#a56362ef9a648c99f079747bffb05fa76">parseSpec</a></div><div class="ttdeci">int parseSpec(rpmts ts, const char *specFile, const char *rootDir, const char *buildRoot, int recursing, const char *passPhrase, const char *cookie, int anyarch, int force)</div><div class="ttdoc">Parse spec file into spec control structure. </div></div>
<div class="ttc" id="structrpmSpec__s_html"><div class="ttname"><a href="structrpmSpec__s.html">rpmSpec_s</a></div><div class="ttdoc">The structure used to store values parsed from a spec file. </div><div class="ttdef"><b>Definition:</b> <a href="rpmspec_8h_source.html#l00094">rpmspec.h:94</a></div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_a4f0e2aefc1295a794cafdebfcede23f9"><div class="ttname"><a href="structrpmBuildArguments__s.html#a4f0e2aefc1295a794cafdebfcede23f9">rpmBuildArguments_s::rootdir</a></div><div class="ttdeci">const char * rootdir</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00330">rpmcli.h:330</a></div></div>
<div class="ttc" id="rpmlib_8h_html_a9c78c502742acadd9f14af15de12fbfe"><div class="ttname"><a href="rpmlib_8h.html#a9c78c502742acadd9f14af15de12fbfe">rpmSetTables</a></div><div class="ttdeci">void rpmSetTables(int archTable, int osTable)</div></div>
<div class="ttc" id="rpmbuild_8h_html_ae07aa303fd6a2ab959bb11a44f7173f9"><div class="ttname"><a href="rpmbuild_8h.html#ae07aa303fd6a2ab959bb11a44f7173f9">doRmSource</a></div><div class="ttdeci">rpmRC doRmSource(rpmSpec spec)</div><div class="ttdoc">Remove all sources assigned to spec file. </div></div>
<div class="ttc" id="rpmts_8h_html_aa9db567bc7c49d7d84ac7fc178543348"><div class="ttname"><a href="rpmts_8h.html#aa9db567bc7c49d7d84ac7fc178543348">rpmVSFlags</a></div><div class="ttdeci">enum rpmVSFlags_e rpmVSFlags</div><div class="ttdoc">Bit(s) to control digest and signature verification. </div></div>
<div class="ttc" id="rpmvf_8h_html_a88edb36096996aa24e1fc3385cb2140aabe476139b5651dcbb51706ba8608a51b"><div class="ttname"><a href="rpmvf_8h.html#a88edb36096996aa24e1fc3385cb2140aabe476139b5651dcbb51706ba8608a51b">VERIFY_SIGNATURE</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmvf_8h_source.html#l00063">rpmvf.h:63</a></div></div>
<div class="ttc" id="rpmstring_8h_html_a1e5f8ebc49cc189053eb455e500d7e00"><div class="ttname"><a href="rpmstring_8h.html#a1e5f8ebc49cc189053eb455e500d7e00">rstreq</a></div><div class="ttdeci">static int rstreq(const char *s1, const char *s2)</div><div class="ttdoc">Test for string equality. </div><div class="ttdef"><b>Definition:</b> <a href="rpmstring_8h_source.html#l00113">rpmstring.h:113</a></div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_ad4c11c26f63a02a2f333c4d8bd4ebcc5"><div class="ttname"><a href="structrpmBuildArguments__s.html#ad4c11c26f63a02a2f333c4d8bd4ebcc5">rpmBuildArguments_s::buildRootOverride</a></div><div class="ttdeci">char * buildRootOverride</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00318">rpmcli.h:318</a></div></div>
<div class="ttc" id="system_8h_html_ab62344482c6d93843e0388d2ba2cf514"><div class="ttname"><a href="system_8h.html#ab62344482c6d93843e0388d2ba2cf514">xstrdup</a></div><div class="ttdeci">#define xstrdup(_str)</div><div class="ttdef"><b>Definition:</b> <a href="system_8h_source.html#l00247">system.h:247</a></div></div>
<div class="ttc" id="rpmmacro_8h_html_a4bb017f52f3bd9b8aae77772b0bc9ba8"><div class="ttname"><a href="rpmmacro_8h.html#a4bb017f52f3bd9b8aae77772b0bc9ba8">rpmExpandNumeric</a></div><div class="ttdeci">int rpmExpandNumeric(const char *arg)</div><div class="ttdoc">Return macro expansion as a numeric value. </div></div>
<div class="ttc" id="rpmps_8h_html_ada7b50cc5ccf1a7f6a05c46330fee3af"><div class="ttname"><a href="rpmps_8h.html#ada7b50cc5ccf1a7f6a05c46330fee3af">rpmpsNumProblems</a></div><div class="ttdeci">int rpmpsNumProblems(rpmps ps)</div><div class="ttdoc">Return number of problems in set. </div></div>
<div class="ttc" id="build_8h_html"><div class="ttname"><a href="build_8h.html">build.h</a></div></div>
<div class="ttc" id="build_8c_html_a440e27826f1e88ca3a9b87e9c0c70423"><div class="ttname"><a href="build_8c.html#a440e27826f1e88ca3a9b87e9c0c70423">checkSpec</a></div><div class="ttdeci">static int checkSpec(rpmts ts, Header h)</div><div class="ttdoc">Parse spec file and build package. </div><div class="ttdef"><b>Definition:</b> <a href="build_8c_source.html#l00026">build.c:26</a></div></div>
<div class="ttc" id="build_8c_html_ab46ac4b5dfbd442e396fe3fb4931e2a0"><div class="ttname"><a href="build_8c.html#ab46ac4b5dfbd442e396fe3fb4931e2a0">getTarSpec</a></div><div class="ttdeci">static char * getTarSpec(const char *arg)</div><div class="ttdef"><b>Definition:</b> <a href="build_8c_source.html#l00102">build.c:102</a></div></div>
<div class="ttc" id="rpmvf_8h_html_a88edb36096996aa24e1fc3385cb2140aa8ebdf945fb2e42959951139d82cb3735"><div class="ttname"><a href="rpmvf_8h.html#a88edb36096996aa24e1fc3385cb2140aa8ebdf945fb2e42959951139d82cb3735">VERIFY_DIGEST</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmvf_8h_source.html#l00062">rpmvf.h:62</a></div></div>
<div class="ttc" id="system_8h_html_ad65a8842cc674e3ddf69355898c0ecbf"><div class="ttname"><a href="system_8h.html#ad65a8842cc674e3ddf69355898c0ecbf">errno</a></div><div class="ttdeci">int errno</div></div>
<div class="ttc" id="rpmlib_8h_html_a41a8861e7ff5c8d189305d9ff1319beeacdba72b619ac562066bdcdf99d48f8bf"><div class="ttname"><a href="rpmlib_8h.html#a41a8861e7ff5c8d189305d9ff1319beeacdba72b619ac562066bdcdf99d48f8bf">RPM_MACHTABLE_BUILDARCH</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmlib_8h_source.html#l00065">rpmlib.h:65</a></div></div>
<div class="ttc" id="rpmts_8h_html_a14f855b79d0aff83c084e254e2442006"><div class="ttname"><a href="rpmts_8h.html#a14f855b79d0aff83c084e254e2442006">rpmtsAddInstallElement</a></div><div class="ttdeci">int rpmtsAddInstallElement(rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)</div><div class="ttdoc">Add package to be installed to transaction set. </div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_a08409409211f35ab0855b369d9ba729c"><div class="ttname"><a href="structrpmBuildArguments__s.html#a08409409211f35ab0855b369d9ba729c">rpmBuildArguments_s::targets</a></div><div class="ttdeci">char * targets</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00319">rpmcli.h:319</a></div></div>
<div class="ttc" id="rpmfileutil_8h_html_ae3a5064720ea1f5929f4f1b059d8a80c"><div class="ttname"><a href="rpmfileutil_8h.html#ae3a5064720ea1f5929f4f1b059d8a80c">rpmMkdirs</a></div><div class="ttdeci">int rpmMkdirs(const char *root, const char *pathstr)</div><div class="ttdoc">Create several directories (including parents if needed) in one go. </div></div>
<div class="ttc" id="rpmts_8h_html_a3826c79a58fcf7b734e73fe2b867b900"><div class="ttname"><a href="rpmts_8h.html#a3826c79a58fcf7b734e73fe2b867b900">rpmtsSetSpec</a></div><div class="ttdeci">rpmSpec rpmtsSetSpec(rpmts ts, rpmSpec spec)</div><div class="ttdoc">Set a spec control structure in transaction set. </div></div>
<div class="ttc" id="rpmps_8h_html_a3a181ab1707f03e032005f3ac442c813"><div class="ttname"><a href="rpmps_8h.html#a3a181ab1707f03e032005f3ac442c813">rpmpsFree</a></div><div class="ttdeci">rpmps rpmpsFree(rpmps ps)</div><div class="ttdoc">Destroy a problem set. </div></div>
<div class="ttc" id="build_8c_html_ad3df6f61106f5e78d7c684e85e10d397"><div class="ttname"><a href="build_8c.html#ad3df6f61106f5e78d7c684e85e10d397">_anyarch</a></div><div class="ttdeci">#define _anyarch(_f)</div></div>
<div class="ttc" id="rpmfileutil_8h_html_a082c9f1c3b1e4fef327ac91a87ca51e9"><div class="ttname"><a href="rpmfileutil_8h.html#a082c9f1c3b1e4fef327ac91a87ca51e9">rpmGetPath</a></div><div class="ttdeci">char * rpmGetPath(const char *path,...) RPM_GNUC_NULL_TERMINATED</div><div class="ttdoc">Return (malloc&#39;ed) expanded, canonicalized, file path. </div></div>
<div class="ttc" id="rpmmacro_8h_html_aa4e9d6d8d215046ee21acb156c659efe"><div class="ttname"><a href="rpmmacro_8h.html#aa4e9d6d8d215046ee21acb156c659efe">addMacro</a></div><div class="ttdeci">void addMacro(rpmMacroContext mc, const char *n, const char *o, const char *b, int level)</div><div class="ttdoc">Add macro to context. </div></div>
<div class="ttc" id="rpmspec_8h_html_a355d23711761ca81710ff75930b930ed"><div class="ttname"><a href="rpmspec_8h.html#a355d23711761ca81710ff75930b930ed">freeSpec</a></div><div class="ttdeci">rpmSpec freeSpec(rpmSpec spec)</div><div class="ttdoc">Destroy Spec structure. </div></div>
<div class="ttc" id="rpmts_8h_html_a7515813532c9d4ead6bfd4b51860078f"><div class="ttname"><a href="rpmts_8h.html#a7515813532c9d4ead6bfd4b51860078f">_RPMVSF_NOSIGNATURES</a></div><div class="ttdeci">#define _RPMVSF_NOSIGNATURES</div><div class="ttdef"><b>Definition:</b> <a href="rpmts_8h_source.html#l00107">rpmts.h:107</a></div></div>
<div class="ttc" id="rpmmacro_8h_html_a1a83ba3c147a4005c80485cc2161bf3b"><div class="ttname"><a href="rpmmacro_8h.html#a1a83ba3c147a4005c80485cc2161bf3b">rpmFreeMacros</a></div><div class="ttdeci">void rpmFreeMacros(rpmMacroContext mc)</div><div class="ttdoc">Destroy macro context. </div></div>
<div class="ttc" id="rpmts_8h_html_a586c60d8364e263aa5e22736cbac1e69"><div class="ttname"><a href="rpmts_8h.html#a586c60d8364e263aa5e22736cbac1e69">rpmtsSetVSFlags</a></div><div class="ttdeci">rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)</div><div class="ttdoc">Set verify signatures flag(s). </div></div>
<div class="ttc" id="rpmmacro_8h_html_a39b56d7237065eaa71f253a6c2dbcfea"><div class="ttname"><a href="rpmmacro_8h.html#a39b56d7237065eaa71f253a6c2dbcfea">rpmExpand</a></div><div class="ttdeci">char * rpmExpand(const char *arg,...) RPM_GNUC_NULL_TERMINATED</div><div class="ttdoc">Return (malloc&#39;ed) concatenated macro expansion(s). </div></div>
<div class="ttc" id="rpmtypes_8h_html_a1a512138316a227059ca128597dbd464"><div class="ttname"><a href="rpmtypes_8h.html#a1a512138316a227059ca128597dbd464">rpmts</a></div><div class="ttdeci">struct rpmts_s * rpmts</div><div class="ttdoc">The main types involved in transaction manipulation. </div><div class="ttdef"><b>Definition:</b> <a href="rpmtypes_8h_source.html#l00059">rpmtypes.h:59</a></div></div>
<div class="ttc" id="system_8h_html"><div class="ttname"><a href="system_8h.html">system.h</a></div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_ac6b5abc7094bf89fc334587eca74679c"><div class="ttname"><a href="structrpmBuildArguments__s.html#ac6b5abc7094bf89fc334587eca74679c">rpmBuildArguments_s::force</a></div><div class="ttdeci">int force</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00322">rpmcli.h:322</a></div></div>
<div class="ttc" id="rpmstring_8h_html_aef54821b6f5090df66cb7e99e1e8e3c8"><div class="ttname"><a href="rpmstring_8h.html#aef54821b6f5090df66cb7e99e1e8e3c8">rasprintf</a></div><div class="ttdeci">int rasprintf(char **strp, const char *fmt,...) RPM_GNUC_PRINTF(2</div><div class="ttdoc">asprintf() clone </div></div>
<div class="ttc" id="rpmlib_8h_html_afa5accc1656e25a42e1dbe247405ebe0"><div class="ttname"><a href="rpmlib_8h.html#afa5accc1656e25a42e1dbe247405ebe0">rpmFreeRpmrc</a></div><div class="ttdeci">void rpmFreeRpmrc(void)</div><div class="ttdoc">Destroy rpmrc arch/os compatibility tables. </div></div>
<div class="ttc" id="rpmts_8h_html_a081c96e55d490b5e99505eda7e93602daaa6d0b979fd5881394e98f2912cff11f"><div class="ttname"><a href="rpmts_8h.html#a081c96e55d490b5e99505eda7e93602daaa6d0b979fd5881394e98f2912cff11f">RPMVSF_NOHDRCHK</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmts_8h_source.html#l00086">rpmts.h:86</a></div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_ab4df0b8e1a35e866a52d82c2cb75c404"><div class="ttname"><a href="structrpmBuildArguments__s.html#ab4df0b8e1a35e866a52d82c2cb75c404">rpmBuildArguments_s::cookie</a></div><div class="ttdeci">char * cookie</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00321">rpmcli.h:321</a></div></div>
<div class="ttc" id="rpmmacro_8h_html_a6b8871ea4414512f9d8d35638eb9d683"><div class="ttname"><a href="rpmmacro_8h.html#a6b8871ea4414512f9d8d35638eb9d683">RMIL_TARBALL</a></div><div class="ttdeci">#define RMIL_TARBALL</div><div class="ttdef"><b>Definition:</b> <a href="rpmmacro_8h_source.html#l00041">rpmmacro.h:41</a></div></div>
<div class="ttc" id="rpmts_8h_html_aeece22238af582ac0a41afdafa77df77"><div class="ttname"><a href="rpmts_8h.html#aeece22238af582ac0a41afdafa77df77">_RPMVSF_NODIGESTS</a></div><div class="ttdeci">#define _RPMVSF_NODIGESTS</div><div class="ttdef"><b>Definition:</b> <a href="rpmts_8h_source.html#l00101">rpmts.h:101</a></div></div>
<div class="ttc" id="rpmtypes_8h_html_aa30b10f32f3a5e820ec05d099993e801ab6a502fb02cfd2c16380fa6ac52902d4"><div class="ttname"><a href="rpmtypes_8h.html#aa30b10f32f3a5e820ec05d099993e801ab6a502fb02cfd2c16380fa6ac52902d4">RPMRC_OK</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmtypes_8h_source.html#l00088">rpmtypes.h:88</a></div></div>
<div class="ttc" id="rpmvf_8h_html_a88edb36096996aa24e1fc3385cb2140aa8456599dc01840d5c9a758ebd6bd756c"><div class="ttname"><a href="rpmvf_8h.html#a88edb36096996aa24e1fc3385cb2140aa8456599dc01840d5c9a758ebd6bd756c">VERIFY_HDRCHK</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmvf_8h_source.html#l00065">rpmvf.h:65</a></div></div>
<div class="ttc" id="rpmbuild_8h_html_a23067366f7d82aa059f41658099fda93a7e26df39cdf47fbfe2a1c5069decf033"><div class="ttname"><a href="rpmbuild_8h.html#a23067366f7d82aa059f41658099fda93a7e26df39cdf47fbfe2a1c5069decf033">RPMBUILD_RMSPEC</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmbuild_8h_source.html#l00038">rpmbuild.h:38</a></div></div>
<div class="ttc" id="rpmts_8h_html_ad3104a1a8c915cde09f2101a16f78133"><div class="ttname"><a href="rpmts_8h.html#ad3104a1a8c915cde09f2101a16f78133">rpmtsClean</a></div><div class="ttdeci">void rpmtsClean(rpmts ts)</div><div class="ttdoc">Free memory needed only for dependency checks and ordering. </div></div>
<div class="ttc" id="rpmbuild_8h_html_a23067366f7d82aa059f41658099fda93a473063df8b824255634653ba80a437f2"><div class="ttname"><a href="rpmbuild_8h.html#a23067366f7d82aa059f41658099fda93a473063df8b824255634653ba80a437f2">RPMBUILD_RMSOURCE</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmbuild_8h_source.html#l00035">rpmbuild.h:35</a></div></div>
<div class="ttc" id="rpmps_8h_html_a00bdb06c5d581722ea2dee81ffba3e08"><div class="ttname"><a href="rpmps_8h.html#a00bdb06c5d581722ea2dee81ffba3e08">rpmpsPrint</a></div><div class="ttdeci">void rpmpsPrint(FILE *fp, rpmps ps)</div><div class="ttdoc">Print problems to file handle. </div></div>
<div class="ttc" id="rpmfileutil_8h_html_aa32585dcb214b5099ad0ea3d4044221b"><div class="ttname"><a href="rpmfileutil_8h.html#aa32585dcb214b5099ad0ea3d4044221b">rpmGenPath</a></div><div class="ttdeci">char * rpmGenPath(const char *urlroot, const char *urlmdir, const char *urlfile)</div><div class="ttdoc">Merge 3 args into path, any or all of which may be a url. </div></div>
<div class="ttc" id="structrpmBuildArguments__s_html"><div class="ttname"><a href="structrpmBuildArguments__s.html">rpmBuildArguments_s</a></div><div class="ttdoc">Describe build command line request. </div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00315">rpmcli.h:315</a></div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_a8d427e31d6292eb83e727d18b6c580a8"><div class="ttname"><a href="structrpmBuildArguments__s.html#a8d427e31d6292eb83e727d18b6c580a8">rpmBuildArguments_s::qva_flags</a></div><div class="ttdeci">rpmQueryFlags qva_flags</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00316">rpmcli.h:316</a></div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_a8d974c0d210be9e09d0b356bc5ec878f"><div class="ttname"><a href="structrpmBuildArguments__s.html#a8d974c0d210be9e09d0b356bc5ec878f">rpmBuildArguments_s::buildMode</a></div><div class="ttdeci">char buildMode</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00328">rpmcli.h:328</a></div></div>
<div class="ttc" id="rpmfileutil_8h_html_ac50a8e532768e8bbad7c5f3d25fbecbd"><div class="ttname"><a href="rpmfileutil_8h.html#ac50a8e532768e8bbad7c5f3d25fbecbd">rpmGetCwd</a></div><div class="ttdeci">char * rpmGetCwd(void)</div><div class="ttdoc">Like getcwd() but the result is malloced. </div></div>
<div class="ttc" id="structrpmBuildArguments__s_html_aa62b9b462381a0048ea45f9abef6bb56"><div class="ttname"><a href="structrpmBuildArguments__s.html#aa62b9b462381a0048ea45f9abef6bb56">rpmBuildArguments_s::passPhrase</a></div><div class="ttdeci">const char * passPhrase</div><div class="ttdef"><b>Definition:</b> <a href="rpmcli_8h_source.html#l00320">rpmcli.h:320</a></div></div>
<div class="ttc" id="rpmbuild_8h_html_aabdc53625b4f47c7fac629bf59ac1eee"><div class="ttname"><a href="rpmbuild_8h.html#aabdc53625b4f47c7fac629bf59ac1eee">buildSpec</a></div><div class="ttdeci">rpmRC buildSpec(rpmts ts, rpmSpec spec, int what, int test)</div><div class="ttdoc">Build stages state machine driver. </div></div>
<div class="ttc" id="rpmlog_8h_html_a78b4b601eded4aa0b0e2836510787841"><div class="ttname"><a href="rpmlog_8h.html#a78b4b601eded4aa0b0e2836510787841">rpmlog</a></div><div class="ttdeci">void rpmlog(int code, const char *fmt,...) RPM_GNUC_PRINTF(2</div><div class="ttdoc">Generate a log message using FMT string and option arguments. </div></div>
<div class="ttc" id="structrpmSpec__s_html_a6aa77decfc01f812ea439ca8e7cf9ab6"><div class="ttname"><a href="structrpmSpec__s.html#a6aa77decfc01f812ea439ca8e7cf9ab6">rpmSpec_s::sourceHeader</a></div><div class="ttdeci">Header sourceHeader</div><div class="ttdef"><b>Definition:</b> <a href="rpmspec_8h_source.html#l00132">rpmspec.h:132</a></div></div>
<div class="ttc" id="rpmtag_8h_html_a342756dddb61d125ae851a8b1ab0507ba95466e6949826b1a95ad79a39bb3a014"><div class="ttname"><a href="rpmtag_8h.html#a342756dddb61d125ae851a8b1ab0507ba95466e6949826b1a95ad79a39bb3a014">RPMTAG_REQUIRENAME</a></div><div class="ttdef"><b>Definition:</b> <a href="rpmtag_8h_source.html#l00128">rpmtag.h:128</a></div></div>
<div class="ttc" id="rpmtypes_8h_html_acb1ffe4e2d96b8277f9f46ecc0c7b8a6"><div class="ttname"><a href="rpmtypes_8h.html#acb1ffe4e2d96b8277f9f46ecc0c7b8a6">Header</a></div><div class="ttdeci">struct headerToken_s * Header</div><div class="ttdoc">RPM header and data retrieval types. </div><div class="ttdef"><b>Definition:</b> <a href="rpmtypes_8h_source.html#l00024">rpmtypes.h:24</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>