Updated -r to be more targeted

This commit is contained in:
Pat Riehecky 2014-06-25 12:53:40 -05:00 committed by Johnny Hughes
parent 87c8aeb8f6
commit 8be9a22995

View file

@ -12,7 +12,7 @@ usage() {
echo 'You need to run this from inside a sources git repo' >&2 echo 'You need to run this from inside a sources git repo' >&2
echo '' >&2 echo '' >&2
echo ' -h: This help message' >&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 ' -c: Return in sha:srpm format' >&2
echo ' -q: Suppress warnings' >&2 echo ' -q: Suppress warnings' >&2
echo '' >&2 echo '' >&2
@ -23,6 +23,7 @@ usage() {
echo " $0 -b c7" >&2 echo " $0 -b c7" >&2
echo " $0 -r -b c7" >&2 echo " $0 -r -b c7" >&2
echo " $0 -c -b remotes/origin/c7" >&2 echo " $0 -c -b remotes/origin/c7" >&2
echo " $0 -c -r -b remotes/origin/c7" >&2
exit 1 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 <bugs@centos.org>"
RHELTAG=0 RHELONLY=0
QUIET=0 QUIET=0
WITHCOMMITHASH=0 WITHCOMMITHASH=0
BRANCH="" BRANCH=""
@ -66,8 +58,8 @@ while [[ 0 -eq 0 ]]; do
break break
;; ;;
-r ) -r )
# skip any package with 'centos' in the dist area # Only look at commits by RHEL
RHELTAG=1 RHELONLY=1
shift shift
;; ;;
-c ) -c )
@ -102,16 +94,18 @@ fi
IFS=' IFS='
' '
LOGARGS="--pretty=%H|\%s"
if [[ ${RHELONLY} -eq 1 ]]; then
LOGARGS="${LOGARGS} --author='${RHELAUTHOR}'"
fi
if [[ "x${BRANCH}" != 'x' ]]; then if [[ "x${BRANCH}" != 'x' ]]; then
loglist=$(git log ${BRANCH} --pretty="%H|%s" | filter) LOGARGS="${LOGARGS} ${BRANCH}"
if [[ $? -ne 0 ]]; then fi
exit 1
fi loglist=$(git log ${LOGARGS} |grep import)
else if [[ $? -ne 0 ]]; then
loglist=$(git log --pretty="%H|%s" | filter) exit 1
if [[ $? -ne 0 ]]; then
exit 1
fi
fi fi
# flag for if nothing is found # flag for if nothing is found