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 '' >&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 <bugs@centos.org>"
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,17 +94,19 @@ 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)
LOGARGS="${LOGARGS} ${BRANCH}"
fi
loglist=$(git log ${LOGARGS} |grep import)
if [[ $? -ne 0 ]]; then
exit 1
fi
else
loglist=$(git log --pretty="%H|%s" | filter)
if [[ $? -ne 0 ]]; then
exit 1
fi
fi
# flag for if nothing is found
FOUND=False