k « entry « bash « libraries « resources - csit - Integration tests</title>
<meta name='generator' content='cgit 1.2.3-korg'/>
<meta name='robots' content='noindex, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-data/cgit.css'/>
<script type='text/javascript' src='/cgit.js'></script>
<link rel='shortcut icon' href='/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='http://git.fd.io/csit/atom/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016' type='application/atom+xml'/>
<link rel='vcs-git' href='https://git.fd.io/csit' title='csit Git repository'/>
</head>
<body>
<div id="lfcollabprojects-header">
  <div class="gray-diagonal">
    <div class="header-inner">
      <a
        id="lfcollabprojects-logo"
        href="http://collabprojects.linuxfoundation.org"
        >Linux Foundation Collaborative Projects</a
      >
    </div>
  </div>
</div>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='/cgit-data/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/csit/'>csit</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='815cbb45dff3fd759f2bd4608bb45ee7949dfc55'/><select name='h' onchange='this.form.submit();'>
<option value='master'>master</option>
<option value='oper-20230522'>oper-20230522</option>
<option value='oper-20241028'>oper-20241028</option>
<option value='oper-230327'>oper-230327</option>
<option value='oper-230403'>oper-230403</option>
<option value='oper-230411'>oper-230411</option>
<option value='oper-230417'>oper-230417</option>
<option value='oper-230424'>oper-230424</option>
<option value='oper-230502'>oper-230502</option>
<option value='oper-230509'>oper-230509</option>
<option value='oper-230515'>oper-230515</option>
<option value='oper-230529'>oper-230529</option>
<option value='oper-230605'>oper-230605</option>
<option value='oper-230612'>oper-230612</option>
<option value='oper-230619'>oper-230619</option>
<option value='oper-230626'>oper-230626</option>
<option value='oper-230710'>oper-230710</option>
<option value='oper-230717'>oper-230717</option>
<option value='oper-230724'>oper-230724</option>
<option value='oper-230731'>oper-230731</option>
<option value='oper-230807'>oper-230807</option>
<option value='oper-230814'>oper-230814</option>
<option value='oper-230821'>oper-230821</option>
<option value='oper-230905'>oper-230905</option>
<option value='oper-230911'>oper-230911</option>
<option value='oper-230918'>oper-230918</option>
<option value='oper-230925'>oper-230925</option>
<option value='oper-231002'>oper-231002</option>
<option value='oper-231009'>oper-231009</option>
<option value='oper-231016' selected='selected'>oper-231016</option>
<option value='oper-231023'>oper-231023</option>
<option value='oper-231030'>oper-231030</option>
<option value='oper-231106'>oper-231106</option>
<option value='oper-231113'>oper-231113</option>
<option value='oper-231120'>oper-231120</option>
<option value='oper-231127'>oper-231127</option>
<option value='oper-231204'>oper-231204</option>
<option value='oper-231211'>oper-231211</option>
<option value='oper-231218'>oper-231218</option>
<option value='oper-240115'>oper-240115</option>
<option value='oper-240122'>oper-240122</option>
<option value='oper-240124'>oper-240124</option>
<option value='oper-240129'>oper-240129</option>
<option value='oper-240205'>oper-240205</option>
<option value='oper-240212'>oper-240212</option>
<option value='oper-240219'>oper-240219</option>
<option value='oper-240226'>oper-240226</option>
<option value='oper-240304'>oper-240304</option>
<option value='oper-240311'>oper-240311</option>
<option value='oper-240318'>oper-240318</option>
<option value='oper-240325'>oper-240325</option>
<option value='oper-240402'>oper-240402</option>
<option value='oper-240408'>oper-240408</option>
<option value='oper-240415'>oper-240415</option>
<option value='oper-240422'>oper-240422</option>
<option value='oper-240429'>oper-240429</option>
<option value='oper-240506'>oper-240506</option>
<option value='oper-240513'>oper-240513</option>
<option value='oper-240520'>oper-240520</option>
<option value='oper-240527'>oper-240527</option>
<option value='oper-240603'>oper-240603</option>
<option value='oper-240610'>oper-240610</option>
<option value='oper-240617'>oper-240617</option>
<option value='oper-240624'>oper-240624</option>
<option value='oper-240701'>oper-240701</option>
<option value='oper-240708'>oper-240708</option>
<option value='oper-240715'>oper-240715</option>
<option value='oper-240722'>oper-240722</option>
<option value='oper-240729'>oper-240729</option>
<option value='oper-240805'>oper-240805</option>
<option value='oper-240812'>oper-240812</option>
<option value='oper-240902'>oper-240902</option>
<option value='oper-240909'>oper-240909</option>
<option value='oper-240916'>oper-240916</option>
<option value='oper-240923'>oper-240923</option>
<option value='oper-240930'>oper-240930</option>
<option value='oper-241014'>oper-241014</option>
<option value='oper-241021'>oper-241021</option>
<option value='oper-241028'>oper-241028</option>
<option value='oper-241104'>oper-241104</option>
<option value='oper-241111'>oper-241111</option>
<option value='oper-241117'>oper-241117</option>
<option value='oper-241125'>oper-241125</option>
<option value='oper-rls2210-221128'>oper-rls2210-221128</option>
<option value='oper-rls2210-221205'>oper-rls2210-221205</option>
<option value='oper-rls2302-230320'>oper-rls2302-230320</option>
<option value='oper-rls2302-230327'>oper-rls2302-230327</option>
<option value='oper-rls2306-230525'>oper-rls2306-230525</option>
<option value='oper-rls2306-230529'>oper-rls2306-230529</option>
<option value='oper-rls2306-230605'>oper-rls2306-230605</option>
<option value='oper-rls2306-230612'>oper-rls2306-230612</option>
<option value='oper-rls2306-230619'>oper-rls2306-230619</option>
<option value='oper-rls2306-230626'>oper-rls2306-230626</option>
<option value='oper-rls2306-230629'>oper-rls2306-230629</option>
<option value='oper-rls2306-230710'>oper-rls2306-230710</option>
<option value='oper-rls2310-230921'>oper-rls2310-230921</option>
<option value='oper-rls2310-230925'>oper-rls2310-230925</option>
<option value='oper-rls2310-231016'>oper-rls2310-231016</option>
<option value='oper-rls2310-231023'>oper-rls2310-231023</option>
<option value='oper-rls2310-231030'>oper-rls2310-231030</option>
<option value='oper-rls2402-240125'>oper-rls2402-240125</option>
<option value='oper-rls2402-240129'>oper-rls2402-240129</option>
<option value='oper-rls2402-240205'>oper-rls2402-240205</option>
<option value='oper-rls2402-240219'>oper-rls2402-240219</option>
<option value='oper-rls2402-240304'>oper-rls2402-240304</option>
<option value='oper-rls2406-240523'>oper-rls2406-240523</option>
<option value='oper-rls2406-240603'>oper-rls2406-240603</option>
<option value='oper-rls2406-240610'>oper-rls2406-240610</option>
<option value='oper-rls2406-240617'>oper-rls2406-240617</option>
<option value='oper-rls2406-240624'>oper-rls2406-240624</option>
<option value='oper-rls2406-240701'>oper-rls2406-240701</option>
<option value='oper-rls2406-240708'>oper-rls2406-240708</option>
<option value='oper-rls2406-240715'>oper-rls2406-240715</option>
<option value='oper-rls2406-240722'>oper-rls2406-240722</option>
<option value='oper-rls2410-240926'>oper-rls2410-240926</option>
<option value='oper-rls2410-241017'>oper-rls2410-241017</option>
<option value='oper-rls2410-241030'>oper-rls2410-241030</option>
<option value='oper241007'>oper241007</option>
<option value='rls1606'>rls1606</option>
<option value='rls1609'>rls1609</option>
<option value='rls1701'>rls1701</option>
<option value='rls1704'>rls1704</option>
<option value='rls1707'>rls1707</option>
<option value='rls1710'>rls1710</option>
<option value='rls1801'>rls1801</option>
<option value='rls1801_2'>rls1801_2</option>
<option value='rls1804'>rls1804</option>
<option value='rls1807'>rls1807</option>
<option value='rls1810'>rls1810</option>
<option value='rls1901'>rls1901</option>
<option value='rls1901_1'>rls1901_1</option>
<option value='rls1901_2'>rls1901_2</option>
<option value='rls1901_3'>rls1901_3</option>
<option value='rls1904'>rls1904</option>
<option value='rls1904_1'>rls1904_1</option>
<option value='rls1904_2'>rls1904_2</option>
<option value='rls1908'>rls1908</option>
<option value='rls1908_1'>rls1908_1</option>
<option value='rls1908_2'>rls1908_2</option>
<option value='rls2001'>rls2001</option>
<option value='rls2005'>rls2005</option>
<option value='rls2009'>rls2009</option>
<option value='rls2009_lts'>rls2009_lts</option>
<option value='rls2101'>rls2101</option>
<option value='rls2101_1'>rls2101_1</option>
<option value='rls2106'>rls2106</option>
<option value='rls2110'>rls2110</option>
<option value='rls2202'>rls2202</option>
<option value='rls2206'>rls2206</option>
<option value='rls2210'>rls2210</option>
<option value='rls2302'>rls2302</option>
<option value='rls2306'>rls2306</option>
<option value='rls2310'>rls2310</option>
<option value='rls2402'>rls2402</option>
<option value='rls2406'>rls2406</option>
<option value='rls2410'>rls2410</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Integration tests</td><td class='sub right'>Grokmirror user</td></tr></table>
<table class='tabs'><tr><td>
<a href='/csit/about/?h=oper-231016'>about</a><a href='/csit/?h=oper-231016'>summary</a><a href='/csit/refs/?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>refs</a><a href='/csit/log/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016'>log</a><a class='active' href='/csit/tree/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>tree</a><a href='/csit/commit/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>commit</a><a href='/csit/diff/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>diff</a><a href='/csit/stats/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016'>stats</a></td><td class='form'><form class='right' method='get' action='/csit/log/resources/libraries/bash/entry/check/copyright_year.sh'>
<input type='hidden' name='h' value='oper-231016'/><input type='hidden' name='id' value='815cbb45dff3fd759f2bd4608bb45ee7949dfc55'/><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='/csit/tree/?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>root</a>/<a href='/csit/tree/resources?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>resources</a>/<a href='/csit/tree/resources/libraries?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>libraries</a>/<a href='/csit/tree/resources/libraries/bash?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>bash</a>/<a href='/csit/tree/resources/libraries/bash/entry?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>entry</a>/<a href='/csit/tree/resources/libraries/bash/entry/check?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>check</a>/<a href='/csit/tree/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>copyright_year.sh</a></div><div class='content'>blob: 66667b96ca05bcc7296d0fc89db0c5300423126b (<a href='/csit/plain/resources/libraries/bash/entry/check/copyright_year.sh?h=oper-231016&amp;id=815cbb45dff3fd759f2bd4608bb45ee7949dfc55'>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>
<a id='n38' href='#n38'>38</a>
<a id='n39' href='#n39'>39</a>
<a id='n40' href='#n40'>40</a>
<a id='n41' href='#n41'>41</a>
<a id='n42' href='#n42'>42</a>
<a id='n43' href='#n43'>43</a>
<a id='n44' href='#n44'>44</a>
<a id='n45' href='#n45'>45</a>
<a id='n46' href='#n46'>46</a>
<a id='n47' href='#n47'>47</a>
<a id='n48' href='#n48'>48</a>
<a id='n49' href='#n49'>49</a>
<a id='n50' href='#n50'>50</a>
<a id='n51' href='#n51'>51</a>
<a id='n52' href='#n52'>52</a>
<a id='n53' href='#n53'>53</a>
<a id='n54' href='#n54'>54</a>
<a id='n55' href='#n55'>55</a>
<a id='n56' href='#n56'>56</a>
<a id='n57' href='#n57'>57</a>
<a id='n58' href='#n58'>58</a>
<a id='n59' href='#n59'>59</a>
<a id='n60' href='#n60'>60</a>
<a id='n61' href='#n61'>61</a>
<a id='n62' href='#n62'>62</a>
<a id='n63' href='#n63'>63</a>
<a id='n64' href='#n64'>64</a>
<a id='n65' href='#n65'>65</a>
<a id='n66' href='#n66'>66</a>
<a id='n67' href='#n67'>67</a>
<a id='n68' href='#n68'>68</a>
<a id='n69' href='#n69'>69</a>
<a id='n70' href='#n70'>70</a>
</pre></td>
<td class='lines'><pre><code><style>
@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
}
@media (prefers-color-scheme: light) {
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
}
</style><div class="highlight"><pre><span></span><span class="c1"># Copyright (c) 2020 Cisco and/or its affiliates.</span>
<span class="c1"># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<span class="c1"># you may not use this file except in compliance with the License.</span>
<span class="c1"># You may obtain a copy of the License at:</span>
<span class="c1">#</span>
<span class="c1">#     http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c1">#</span>
<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
<span class="c1"># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c1"># See the License for the specific language governing permissions and</span>
<span class="c1"># limitations under the License.</span>

<span class="nb">set</span> -exuo pipefail

<span class="c1"># This file should be executed from tox, as the assumed working directory</span>
<span class="c1"># is different from where this file is located.</span>
<span class="c1"># This file does not have executable flag nor shebang,</span>
<span class="c1"># to dissuade non-tox callers.</span>

<span class="c1"># This script runs a few grep-based command and fails</span>
<span class="c1"># if it detects any file edited or added since HEAD~</span>
<span class="c1"># containing a copyright notice in first 3 lines,</span>
<span class="c1"># but not the current year (in the same line).</span>
<span class="c1"># The offending lines are stored to copyright_year.log (overwriting).</span>
<span class="c1">#</span>
<span class="c1"># 3 lines were chosen, because first two lines could be shebang and empty line,</span>
<span class="c1"># and more than 3 lines would start failing on files with multiple copyright</span>
<span class="c1"># holders. There, only the last updating entity needs to bump its year,</span>
<span class="c1"># and put other copyright lines below.</span>

<span class="c1"># &quot;set -eu&quot; handles failures from the following two lines.</span>
<span class="nv">BASH_CHECKS_DIR</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>dirname <span class="k">$(</span>readlink -e <span class="s2">&quot;</span><span class="si">${</span><span class="nv">BASH_SOURCE</span><span class="p">[0]</span><span class="si">}</span><span class="s2">&quot;</span><span class="k">))</span><span class="s2">&quot;</span>
<span class="nv">BASH_FUNCTION_DIR</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>readlink -e <span class="s2">&quot;</span><span class="si">${</span><span class="nv">BASH_CHECKS_DIR</span><span class="si">}</span><span class="s2">/../../function&quot;</span><span class="k">)</span><span class="s2">&quot;</span>
<span class="nb">source</span> <span class="s2">&quot;</span><span class="si">${</span><span class="nv">BASH_FUNCTION_DIR</span><span class="si">}</span><span class="s2">/common.sh&quot;</span> <span class="o">||</span> <span class="o">{</span>
    <span class="nb">echo</span> <span class="s2">&quot;Source failed.&quot;</span> &gt;<span class="p">&amp;</span><span class="m">2</span>
    <span class="nb">exit</span> <span class="m">1</span>
<span class="o">}</span>

<span class="nv">year</span><span class="o">=</span><span class="k">$(</span>date +<span class="s1">&#39;%Y&#39;</span><span class="k">)</span>
<span class="nv">IFS</span><span class="o">=</span><span class="s1">$&#39;\n&#39;</span>
<span class="nv">files</span><span class="o">=(</span><span class="k">$(</span>git diff --name-only HEAD~ <span class="o">||</span> <span class="nb">true</span><span class="k">)</span><span class="o">)</span>
<span class="nb">unset</span> IFS
truncate -s <span class="m">0</span> <span class="s2">&quot;copyright_year.log&quot;</span> <span class="o">||</span> die
<span class="c1"># A change can have thousands of files, supress console output in the cycle.</span>
<span class="nb">set</span> +x
<span class="k">for</span> fil in <span class="s2">&quot;</span><span class="si">${</span><span class="nv">files</span><span class="p">[@]</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">;</span> <span class="k">do</span>
    <span class="c1"># Greps do &quot;fail&quot; on 0 line output, we need to ignore that</span>
    <span class="c1"># as 0 lines is good. We need both set +e to ensure everything executes,</span>
    <span class="c1"># and || true later to avoid dying on zero.</span>
    <span class="nv">piped_command</span><span class="o">=</span><span class="s2">&quot;set +ex; head -n 3 &#39;</span><span class="si">${</span><span class="nv">fil</span><span class="si">}</span><span class="s2">&#39; | fgrep -i &#39;Copyright&#39;&quot;</span>
    <span class="nv">piped_command</span><span class="o">+=</span><span class="s2">&quot; | fgrep -v &#39;</span><span class="si">${</span><span class="nv">year</span><span class="si">}</span><span class="s2">&#39; | awk &#39;{print \&quot;</span><span class="si">${</span><span class="nv">fil</span><span class="si">}</span><span class="s2">: \&quot; \$0}&#39;&quot;</span>
    <span class="nv">piped_command</span><span class="o">+=</span><span class="s2">&quot; &gt;&gt; &#39;copyright_year.log&#39;&quot;</span>
    <span class="nv">wrong_strings</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>bash -c <span class="s2">&quot;</span><span class="si">${</span><span class="nv">piped_command</span><span class="si">}</span><span class="s2">&quot;</span> <span class="o">||</span> <span class="nb">true</span><span class="k">)</span><span class="s2">&quot;</span> <span class="o">||</span> die
<span class="k">done</span>
<span class="nb">set</span> -x
<span class="nv">lines</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>&lt; <span class="s2">&quot;copyright_year.log&quot;</span> wc -l<span class="k">)</span><span class="s2">&quot;</span>
<span class="k">if</span> <span class="o">[</span> <span class="s2">&quot;</span><span class="si">${</span><span class="nv">lines</span><span class="si">}</span><span class="s2">&quot;</span> !<span class="o">=</span> <span class="s2">&quot;0&quot;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
    <span class="c1"># TODO: Decide which text goes to stdout and which to stderr.</span>
    warn <span class="s2">&quot;Copyright lines with wrong year detected: </span><span class="si">${</span><span class="nv">lines</span><span class="si">}</span><span class="s2">&quot;</span>
    <span class="c1"># TODO: Disable when output size does more harm than good.</span>
    <span class="nb">pwd</span>
    cat <span class="s2">&quot;copyright_year.log&quot;</span> &gt;<span class="p">&amp;</span><span class="m">2</span>
    warn
    warn <span class="s2">&quot;Copyright year checker: FAIL&quot;</span>
    <span class="nb">exit</span> <span class="m">1</span>
<span class="k">fi</span>

warn
warn <span class="s2">&quot;Copyright year checker: PASS&quot;</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div id="lfcollabprojects-footer">
  <div class="gray-diagonal">
    <div class="footer-inner">
      <p>
        &copy; 2016 <a href="https://www.fd.io/">FD.io</a> a Linux Foundation
        Collaborative Project. All Rights Reserved.
      </p>
      <p>
        Linux Foundation is a registered trademark of The Linux Foundation.
        Linux is a registered
        <a
          href="http://www.linuxfoundation.org/programs/legal/trademark"
          title="Linux Mark Institute"
          >trademark</a
        >
        of Linus Torvalds.
      </p>
      <p>
        Please see our
        <a href="http://www.linuxfoundation.org/privacy">privacy policy</a> and
        <a href="http://www.linuxfoundation.org/terms">terms of use</a>
      </p>
    </div>
  </div>
</div>
</div> <!-- id=cgit -->
</body>
</html>
