<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div>If getopts comes across an unknown argument, $arg it set to '?' and $OPTARG is unset. Therefore the getopts line detecting unknown arguments doesn't work. Arguments to pass to makepkg are already handled by passing all the aguments after the end-of-options marker (--), but this wasn't documented in the usage text. </div>

<div><br></div><div>---</div><div> <a href="http://makechrootpkg.in/" target="_blank">makechrootpkg.in</a> | 5 ++---</div><div> 1 file changed, 2 insertions(+), 3 deletions(-)</div><div><br></div><div>diff --git a/<a href="http://makechrootpkg.in/" target="_blank">makechrootpkg.in</a> b/<a href="http://makechrootpkg.in/" target="_blank">makechrootpkg.in</a></div>

<div>index d03b703..9db0ddd 100644</div><div>--- a/<a href="http://makechrootpkg.in/" target="_blank">makechrootpkg.in</a></div><div>+++ b/<a href="http://makechrootpkg.in/" target="_blank">makechrootpkg.in</a></div><div>

@@ -35,8 +35,8 @@ src_owner=${SUDO_USER:-$USER}</div><div> usage() {</div><div> <span style="white-space:pre-wrap">     </span>echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"</div><div> <span style="white-space:pre-wrap">     </span>echo ' Run this script in a PKGBUILD dir to build a package inside a'</div>

<div>-<span style="white-space:pre-wrap"> </span>echo ' clean chroot. All unrecognized arguments passed to this script'</div><div>-<span style="white-space:pre-wrap">  </span>echo ' will be passed to makepkg.'</div>

<div>+<span style="white-space:pre-wrap"> </span>echo ' clean chroot. Arguments passed to this script after the'</div><div>+<span style="white-space:pre-wrap"> </span>echo ' end-of-options marker (--) will be passed to makepkg.'</div>

<div> <span style="white-space:pre-wrap"> </span>echo ''</div><div> <span style="white-space:pre-wrap"> </span>echo ' The chroot dir consists of the following directories:'</div><div> <span style="white-space:pre-wrap">   </span>echo ' <chrootdir>/{root, copy} but only "root" is required'</div>

<div>@@ -78,7 +78,6 @@ while getopts 'hcur:I:l:nTD:d:' arg; do</div><div> <span style="white-space:pre-wrap">         </span>l) copy="$OPTARG" ;;</div><div> <span style="white-space:pre-wrap">          </span>n) run_namcap=true; makepkg_args="$makepkg_args -i" ;;</div>

<div> <span style="white-space:pre-wrap">         </span>T) temp_chroot=true; copy+="-$$" ;;</div><div>-<span style="white-space:pre-wrap">           </span>*) makepkg_args="$makepkg_args -$arg $OPTARG" ;;</div><div>
 <span style="white-space:pre-wrap">    </span>esac</div>
<div> done</div><div class=""><div id=":14e" class="" tabindex="0"><img class="" src="https://mail.google.com/mail/u/0/images/cleardot.gif"></div></div><span class=""><font color="#888888"><div> </div><div>-- </div><div>
1.9.0</div>
</font></span></div></div>