<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">derp, thanks! I sent the wrong diff....<br>
      <br>
      On 06/10/2014 09:27 AM, Mike McLean wrote:<br>
    </div>
    <blockquote
cite="mid:CAJ=Sm7G9ORKpVSUVs5W0mVDyaOwTZQWXpJTTTi96633vShSUug@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <div dir="ltr">typo<br>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On Tue, Jun 10, 2014 at 10:12 AM,
            Karanbir Singh <span dir="ltr">&lt;<a
                moz-do-not-send="true"
                href="mailto:mail-lists@karan.org" target="_blank">mail-lists@karan.org</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">Applied,
              pushed, thanks<br>
              <a moz-do-not-send="true"
                href="https://git.centos.org/summary/centos-git-common"
                target="_blank">https://git.centos.org/summary/centos-git-common</a><br>
              <div>
                <div><br>
                  <br>
                  On 06/10/2014 03:08 PM, Pat Riehecky wrote:<br>
                  &gt; From: Pat Riehecky &lt;<a moz-do-not-send="true"
                    href="mailto:riehecky@fnal.gov" target="_blank">riehecky@fnal.gov</a>&gt;<br>
                  &gt;<br>
                  &gt; ---<br>
                  &gt; &nbsp;return_disttag.sh | &nbsp; 71
                  +++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
                  &gt; &nbsp;1 files changed, 71 insertions(+), 0
                  deletions(-)<br>
                  &gt; &nbsp;create mode 100755 return_disttag.sh<br>
                  &gt;<br>
                  &gt; diff --git a/return_disttag.sh
                  b/return_disttag.sh<br>
                  &gt; new file mode 100755<br>
                  &gt; index 0000000..cc4829c<br>
                  &gt; --- /dev/null<br>
                  &gt; +++ b/return_disttag.sh<br>
                  &gt; @@ -0,0 +1,71 @@<br>
                  &gt; +#!/bin/bash -u<br>
                  &gt; +#<br>
                  &gt; +# Extracts what appears to be the value of
                  %{dist} from the commit message<br>
                  &gt; +#<br>
                  &gt; +# Might want to drop this in ~/bin/ and chmod
                  u+x it<br>
                  &gt; +<br>
                  &gt;
                  +#####################################################################<br>
                  &gt; +usage() {<br>
                  &gt; + &nbsp; &nbsp;echo '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;echo "$0 [-hr]" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;echo '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;echo ' -h: This help message' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;echo ' -r: Use the Redhat tag rather than
                  centos tag' &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;echo '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;echo ' &nbsp;Attempt to extract what appears to
                  be the value of %{dist}' &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;echo ' &nbsp;from the <a moz-do-not-send="true"
                    href="http://git.centos.org" target="_blank">git.centos.org</a>
                  commit message' &nbsp; &nbsp; &nbsp; &gt;&amp;2<br>
                  &gt; + &nbsp; &nbsp;exit 1<br>
                  &gt; +}<br>
                  &gt; +<br>
                  &gt; +<br>
                  &gt;
                  +#####################################################################<br>
                  &gt; +# setup args in the right order for making
                  getopt evaluation<br>
                  &gt; +# nice and easy. &nbsp;You'll need to read the
                  manpages for more info<br>
                  &gt; +args=$(getopt -o hr -- "$@")<br>
                  &gt; +if [[ $? -ne 0 ]]; then<br>
                  &gt; + &nbsp; &nbsp;usage<br>
                  &gt; +fi<br>
                  &gt; +eval set -- "$args"<br>
                  &gt; +<br>
                  &gt; +RHELTAG=0<br>
                  &gt; +for arg in $@; do<br>
                  &gt; + &nbsp; &nbsp;case $1 in<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp;-- )<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# end of getopt args, shift off the
                  -- and get out of the loop<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shift<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break 2<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; -r )<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# skip any package with 'centos' in
                  the dist area<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RHELTAG=1<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; -h )<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# get help<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;usage<br>
                  &gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br>
                  &gt; + &nbsp; &nbsp;esac<br>
                  &gt; +done<br>
                  &gt; +<br>
                  &gt; +packagename=$(basename `pwd`)<br>
                  &gt; +metadata=.${packagename}.metadata<br>
                  &gt; +<br>
                  &gt; +if [[ ! -e ${metadata} ]] || &nbsp;[[ ! -d .git ]] ||
                  [[ ! -d SOURCES ]]; then<br>
                  &gt; + &nbsp; &nbsp;echo 'You need to run this from inside a
                  sources git repo'<br>
                  &gt; + &nbsp; &nbsp;exit 1<br>
                  &gt; +fi<br>
                  &gt; +<br>
                  &gt; +msg=$(git log --pretty=format:"%s")<br>
                  &gt; +pkg=$(echo ${msg} | cut -d' ' -f2)<br>
                  &gt; +<br>
                  &gt; +if [[ ${RHELTAG} -eq 0 ]]; then<br>
                  &gt; + &nbsp; &nbsp;thispkg=(echo ${pkg} | head -1)<br>
                  &gt; +elif [[ ${RHELTAG} -eq 1 ]]; then<br>
                  &gt; + &nbsp; &nbsp;thispkg=(echo ${pkg} grep -v centos | head
                  -1)<br>
                  &gt; +else<br>
                  &gt; + &nbsp; &nbsp;echo 'Something went terribly wrong'<br>
                  &gt; + &nbsp; &nbsp;exit 1<br>
                  &gt; +fi<br>
                  &gt; +<br>
                  &gt; +tag=$(echo ${thispkg} | awk -F"-" '{print $NF}'
                  | tr '.' '\012'| grep -e el[[:digit:]])<br>
                  &gt; +<br>
                  &gt; +echo ${tag}<br>
                  &gt;<br>
                  <br>
                  <br>
                  --<br>
                </div>
              </div>
              <span><font color="#888888">Karanbir Singh<br>
                  <a moz-do-not-send="true" href="tel:%2B44-207-0999389"
                    value="+442070999389" target="_blank">+44-207-0999389</a>&nbsp;|
                  <a moz-do-not-send="true" href="http://www.karan.org/"
                    target="_blank">http://www.karan.org/</a> | <a
                    moz-do-not-send="true"
                    href="http://twitter.com/kbsingh" target="_blank">twitter.com/kbsingh</a><br>
                  GnuPG Key : <a moz-do-not-send="true"
                    href="http://www.karan.org/publickey.asc"
                    target="_blank">http://www.karan.org/publickey.asc</a><br>
                </font></span>
              <div>
                <div>_______________________________________________<br>
                  CentOS-devel mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:CentOS-devel@centos.org"
                    target="_blank">CentOS-devel@centos.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.centos.org/mailman/listinfo/centos-devel"
                    target="_blank">http://lists.centos.org/mailman/listinfo/centos-devel</a><br>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
CentOS-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CentOS-devel@centos.org">CentOS-devel@centos.org</a>
<a class="moz-txt-link-freetext" href="http://lists.centos.org/mailman/listinfo/centos-devel">http://lists.centos.org/mailman/listinfo/centos-devel</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Pat Riehecky

Scientific Linux developer
<a class="moz-txt-link-freetext" href="http://www.scientificlinux.org/">http://www.scientificlinux.org/</a></pre>
  </body>
</html>