From 8be9a229957a9144c0ae1261af263a95c49baac2 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Jun 25 2014 17:53:40 +0000 Subject: Updated -r to be more targeted --- diff --git a/show_possible_srpms.sh b/show_possible_srpms.sh index 3092172..089412c 100755 --- a/show_possible_srpms.sh +++ b/show_possible_srpms.sh @@ -12,7 +12,7 @@ usage() { echo 'You need to run this from inside a sources git repo' >&2 echo '' >&2 echo ' -h: This help message' >&2 - echo ' -r: Use the Redhat tag rather than centos tag' >&2 + echo ' -r: Use the Redhat commits only' >&2 echo ' -c: Return in sha:srpm format' >&2 echo ' -q: Suppress warnings' >&2 echo '' >&2 @@ -23,6 +23,7 @@ usage() { echo " $0 -b c7" >&2 echo " $0 -r -b c7" >&2 echo " $0 -c -b remotes/origin/c7" >&2 + echo " $0 -c -r -b remotes/origin/c7" >&2 exit 1 } @@ -33,19 +34,10 @@ warn () { } ##################################################################### -filter () { - # filter used for log messages - if [[ ${RHELTAG} -eq 1 ]] - then - grep -v centos | grep import - else - grep import - fi -} -##################################################################### +RHELAUTHOR="CentOS Buildsys " -RHELTAG=0 +RHELONLY=0 QUIET=0 WITHCOMMITHASH=0 BRANCH="" @@ -66,8 +58,8 @@ while [[ 0 -eq 0 ]]; do break ;; -r ) - # skip any package with 'centos' in the dist area - RHELTAG=1 + # Only look at commits by RHEL + RHELONLY=1 shift ;; -c ) @@ -102,16 +94,18 @@ fi IFS=' ' +LOGARGS="--pretty=%H|\%s" +if [[ ${RHELONLY} -eq 1 ]]; then + LOGARGS="${LOGARGS} --author='${RHELAUTHOR}'" +fi + if [[ "x${BRANCH}" != 'x' ]]; then - loglist=$(git log ${BRANCH} --pretty="%H|%s" | filter) - if [[ $? -ne 0 ]]; then - exit 1 - fi -else - loglist=$(git log --pretty="%H|%s" | filter) - if [[ $? -ne 0 ]]; then - exit 1 - fi + LOGARGS="${LOGARGS} ${BRANCH}" +fi + +loglist=$(git log ${LOGARGS} |grep import) +if [[ $? -ne 0 ]]; then + exit 1 fi # flag for if nothing is found