 this file 'description' to name the repository.</title>
<meta name='generator' content='cgit '/>
<meta name='robots' content='index, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-data/cgit.css'/>
<link rel='shortcut icon' href='/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/atom/source3/script/installmodules.sh?h=master' type='application/atom+xml'/>
<link rel='vcs-git' href='git://fedorapeople.org/home/fedora/pviktori/public_git/samba.git' title='samba.git Git repository'/>
<link rel='vcs-git' href='ssh://fedorapeople.org/home/fedora/pviktori/public_git/samba.git' title='samba.git Git repository'/>
<link rel='vcs-git' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git' title='samba.git Git repository'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/cgit/'><img src='/cgit-data/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/cgit/'>index</a> : <a title='samba.git' href='/cgit/pviktori/public_git/samba.git/'>samba.git</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='5b827dfd8b20e4c268a594e733765bef147020fb'/><select name='h' onchange='this.form.submit();'>
<option value='master' selected='selected'>master</option>
<option value='py3compat-34ad28d'>py3compat-34ad28d</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Unnamed repository; edit this file 'description' to name the repository.</td><td class='sub right'>Petr Viktorin</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit/pviktori/public_git/samba.git/'>summary</a><a href='/cgit/pviktori/public_git/samba.git/refs/?id=5b827dfd8b20e4c268a594e733765bef147020fb'>refs</a><a href='/cgit/pviktori/public_git/samba.git/log/source3/script/installmodules.sh'>log</a><a class='active' href='/cgit/pviktori/public_git/samba.git/tree/source3/script/installmodules.sh?id=5b827dfd8b20e4c268a594e733765bef147020fb'>tree</a><a href='/cgit/pviktori/public_git/samba.git/commit/source3/script/installmodules.sh?id=5b827dfd8b20e4c268a594e733765bef147020fb'>commit</a><a href='/cgit/pviktori/public_git/samba.git/diff/source3/script/installmodules.sh?id=5b827dfd8b20e4c268a594e733765bef147020fb'>diff</a><a href='/cgit/pviktori/public_git/samba.git/stats/source3/script/installmodules.sh'>stats</a></td><td class='form'><form class='right' method='get' action='/cgit/pviktori/public_git/samba.git/log/source3/script/installmodules.sh'>
<input type='hidden' name='id' value='5b827dfd8b20e4c268a594e733765bef147020fb'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit/pviktori/public_git/samba.git/tree/?id=5b827dfd8b20e4c268a594e733765bef147020fb'>root</a>/<a href='/cgit/pviktori/public_git/samba.git/tree/source3?id=5b827dfd8b20e4c268a594e733765bef147020fb'>source3</a>/<a href='/cgit/pviktori/public_git/samba.git/tree/source3/script?id=5b827dfd8b20e4c268a594e733765bef147020fb'>script</a>/<a href='/cgit/pviktori/public_git/samba.git/tree/source3/script/installmodules.sh?id=5b827dfd8b20e4c268a594e733765bef147020fb'>installmodules.sh</a></div><div class='content'>blob: f70db003ede38c8cd4b22edcbc033d991779b5fa (<a href='/cgit/pviktori/public_git/samba.git/plain/source3/script/installmodules.sh?id=5b827dfd8b20e4c268a594e733765bef147020fb'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
<a id='n8' href='#n8'>8</a>
<a id='n9' href='#n9'>9</a>
<a id='n10' href='#n10'>10</a>
<a id='n11' href='#n11'>11</a>
<a id='n12' href='#n12'>12</a>
<a id='n13' href='#n13'>13</a>
<a id='n14' href='#n14'>14</a>
<a id='n15' href='#n15'>15</a>
<a id='n16' href='#n16'>16</a>
<a id='n17' href='#n17'>17</a>
<a id='n18' href='#n18'>18</a>
<a id='n19' href='#n19'>19</a>
<a id='n20' href='#n20'>20</a>
<a id='n21' href='#n21'>21</a>
<a id='n22' href='#n22'>22</a>
<a id='n23' href='#n23'>23</a>
<a id='n24' href='#n24'>24</a>
<a id='n25' href='#n25'>25</a>
<a id='n26' href='#n26'>26</a>
<a id='n27' href='#n27'>27</a>
<a id='n28' href='#n28'>28</a>
<a id='n29' href='#n29'>29</a>
<a id='n30' href='#n30'>30</a>
<a id='n31' href='#n31'>31</a>
<a id='n32' href='#n32'>32</a>
<a id='n33' href='#n33'>33</a>
<a id='n34' href='#n34'>34</a>
<a id='n35' href='#n35'>35</a>
<a id='n36' href='#n36'>36</a>
<a id='n37' href='#n37'>37</a>
</pre></td>
<td class='lines'><pre><code><span class="hl slc">#!/bin/sh</span>

INSTALLPERMS<span class="hl opt">=</span><span class="hl kwd">$1</span>
DESTDIR<span class="hl opt">=</span><span class="hl kwd">$2</span>
prefix<span class="hl opt">=</span><span class="hl str">`echo</span> <span class="hl ipl">$3</span> <span class="hl str">| sed &#39;s/\/\//\//g&#39;`</span>
LIBDIR<span class="hl opt">=</span><span class="hl str">`echo</span> <span class="hl ipl">$4</span> <span class="hl str">| sed &#39;s/\/\//\//g&#39;`</span>
<span class="hl kwb">shift</span>
<span class="hl kwb">shift</span>
<span class="hl kwb">shift</span>
<span class="hl kwb">shift</span>

<span class="hl kwa">for</span> d <span class="hl kwa">in</span> <span class="hl kwd">$prefix $LIBDIR</span><span class="hl opt">;</span> <span class="hl kwa">do</span>
<span class="hl kwa">if</span> <span class="hl opt">[ !</span> <span class="hl kwb">-d</span> <span class="hl kwd">$DESTDIR</span><span class="hl opt">/</span><span class="hl kwd">$d</span> <span class="hl opt">];</span> <span class="hl kwa">then</span>
<span class="hl kwc">mkdir</span> <span class="hl kwd">$DESTDIR</span><span class="hl opt">/</span><span class="hl kwd">$d</span>
<span class="hl kwa">if</span> <span class="hl opt">[ !</span> <span class="hl kwb">-d</span> <span class="hl kwd">$DESTDIR</span><span class="hl opt">/</span><span class="hl kwd">$d</span> <span class="hl opt">];</span> <span class="hl kwa">then</span>
  <span class="hl kwb">echo</span> Failed to <span class="hl kwc">make</span> directory <span class="hl kwd">$DESTDIR</span><span class="hl opt">/</span><span class="hl kwd">$d</span>
  <span class="hl kwb">exit</span> <span class="hl num">1</span>
<span class="hl kwa">fi</span>
<span class="hl kwa">fi</span>
<span class="hl kwa">done</span>

<span class="hl slc"># We expect the last component of LIBDIR to be the module type, eg. idmap,</span>
<span class="hl slc"># pdb. By stripping this from the installation name, you can have multiple</span>
<span class="hl slc"># modules of the same name but different types by creating eg. idmap_foo</span>
<span class="hl slc"># and pdb_foo. This makes the most sense for idmap and pdb module, where</span>
<span class="hl slc"># they need to be consistent.</span>
mtype<span class="hl opt">=</span><span class="hl str">`basename</span> <span class="hl ipl">$LIBDIR</span><span class="hl str">`</span>

<span class="hl kwa">for</span> p <span class="hl kwa">in</span> $<span class="hl opt">*;</span> <span class="hl kwa">do</span>
 p2<span class="hl opt">=</span><span class="hl str">`basename</span> <span class="hl ipl">$p</span><span class="hl str">`</span>
 name<span class="hl opt">=</span><span class="hl str">`echo</span> <span class="hl ipl">$p2</span> <span class="hl str">| sed -es/</span><span class="hl ipl">${mtype}</span><span class="hl str">_//`</span>
 <span class="hl kwb">echo</span> Installing <span class="hl kwd">$p</span> as <span class="hl kwd">$DESTDIR</span><span class="hl opt">/</span><span class="hl kwd">$LIBDIR</span><span class="hl opt">/</span><span class="hl kwd">$name</span>
 <span class="hl kwc">cp</span> <span class="hl kwb">-f</span> <span class="hl kwd">$p $DESTDIR</span><span class="hl opt">/</span><span class="hl kwd">$LIBDIR</span><span class="hl opt">/</span><span class="hl kwd">$name</span>
 <span class="hl kwc">chmod</span> <span class="hl kwd">$INSTALLPERMS $DESTDIR</span><span class="hl opt">/</span><span class="hl kwd">$LIBDIR</span><span class="hl opt">/</span><span class="hl kwd">$name</span>
<span class="hl kwa">done</span>

<span class="hl kwb">exit</span> <span class="hl num">0</span>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit </a> (<a href='https://git-scm.com/'>git 2.34.1</a>) at 2025-10-14 08:49:34 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
