diff options
author | Bjoern Tropf <asym@gentoo.org> | 2009-12-19 12:53:55 +0100 |
---|---|---|
committer | Bjoern Tropf <asym@gentoo.org> | 2009-12-19 12:53:55 +0100 |
commit | 26edc0e62dfadfb032306458300fb5437aca42e7 (patch) | |
tree | 88b55a2bbefc82faf5ec45d9458349c47072734f | |
parent | Fix invalid CVSS data (diff) | |
download | kernel-check-26edc0e62dfadfb032306458300fb5437aca42e7.tar.gz kernel-check-26edc0e62dfadfb032306458300fb5437aca42e7.tar.bz2 kernel-check-26edc0e62dfadfb032306458300fb5437aca42e7.zip |
Rename findcommit.sh to fcommit
Fix some bugs
-rwxr-xr-x | bin/fcommit (renamed from tools/findcommit.sh) | 26 | ||||
-rwxr-xr-x | pym/kernelcheck/kernelcheck.py | 4 |
2 files changed, 16 insertions, 14 deletions
diff --git a/tools/findcommit.sh b/bin/fcommit index be1814f..68835a9 100755 --- a/tools/findcommit.sh +++ b/bin/fcommit @@ -4,8 +4,6 @@ # Distributed under the terms of the GNU General Public License v2 TEXT=".*$@.*" -GITPATH="./" - KNOWNCOMMITS="" LASTFIXEDBRANCH="" WHITEBOARD="" @@ -15,17 +13,20 @@ BAD=$'\e[31;01m' BRACKET=$'\e[34;01m' NORMAL=$'\e[0m' -GITPATH="--git-dir=$GITPATH.git --work-tree=$GITPATH" -BRANCHES="`git $GITPATH branch -a | grep linux` origin/master" +BRANCHES="`git branch -a | grep linux` origin/master" for B in $BRANCHES ; do - COMMITS="`git $GITPATH rev-list --pretty=oneline "$B" | + COMMITS="`git rev-list --pretty=oneline "$B" | grep "$TEXT" | cut -d " " -f 1`" for C in $COMMITS ; do if [ "${KNOWNCOMMITS/$C/}" == "$KNOWNCOMMITS" ] ; then - TAG="`git $GITPATH describe --contains --all "$C"`" - DESC="`git $GITPATH --no-pager log -1 --pretty=short "$C"`" + TAG="`git describe --contains --all "$C"`" + LABEL="${TAG/remotes\/origin\/linux-/v}" + LABEL="${LABEL/tags\//}" + + DESC="`git --no-pager log -1 --pretty=short "$C"`" DESC="`echo "$DESC" | tr -s "\n" `" - DESC="${TAG/tags\//\n${GOOD}label${NORMAL} }\n${DESC}" + DESC="${GOOD}label${NORMAL} ${LABEL}\n${DESC}" + DESC="${DESC/commit/${GOOD}commit${NORMAL}}" DESC="${DESC/Author:/${GOOD}author${NORMAL}}" DESC="${DESC/ /${GOOD}title${NORMAL} ${BRACKET}}${NORMAL}\n" @@ -47,11 +48,11 @@ for B in $BRANCHES ; do WHITEBOARD="$WHITEBOARD [linux <${VERSION}]" else if [ "${LASTFIXEDBRANCH}" == "${VERSION/-rc*/}" ] ; then - WHITEBOARD="${WHITEBOARD} ${BAD}[linux >=" \ - "${LASTFIXEDBRANCH} <${VERSION}]${NORMAL}" + WHITEBOARD="${WHITEBOARD} ${BAD}[linux >= \ + ${LASTFIXEDBRANCH} <${VERSION}]${NORMAL}" else - WHITEBOARD="${WHITEBOARD} [linux >=" \ - "${LASTFIXEDBRANCH} <${VERSION}]" + WHITEBOARD="${WHITEBOARD} [linux >= \ + ${LASTFIXEDBRANCH} <${VERSION}]" fi fi LASTFIXEDBRANCH=$NEXTBRANCH @@ -60,3 +61,4 @@ for B in $BRANCHES ; do done done echo -e "${GOOD}Whiteboard${NORMAL}\n${WHITEBOARD:1}\n" + diff --git a/pym/kernelcheck/kernelcheck.py b/pym/kernelcheck/kernelcheck.py index ce9d112..f097a39 100755 --- a/pym/kernelcheck/kernelcheck.py +++ b/pym/kernelcheck/kernelcheck.py @@ -104,13 +104,13 @@ def main(argv): evaluation = lib.eval_cve_files(lib.KERNELDIR, kernel, spinner()) if not evaluation: - print("\b\b done!\n") + print("\b\b done!") EOutput().eerror('No kernel vulnerability files found!') return kernel_updates = lib.eval_kernel_updates(kernel, evaluation, spinner()) - print("\b\b done!\n") + print("\b\b done!") if len(evaluation.affected) is not 0: print_summary(evaluation.affected, kernel_updates) |