blob: 68835a97665f658d56360c93052caf521dd70e53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#!/bin/sh
# kernel-check -- Gentoo Kernel Security
# Copyright 2009-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
TEXT=".*$@.*"
KNOWNCOMMITS=""
LASTFIXEDBRANCH=""
WHITEBOARD=""
GOOD=$'\e[32;01m'
BAD=$'\e[31;01m'
BRACKET=$'\e[34;01m'
NORMAL=$'\e[0m'
BRANCHES="`git branch -a | grep linux` origin/master"
for B in $BRANCHES ; do
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 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="${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"
echo -e "$DESC"
VERSION="${TAG/tags\/v/}"
VERSION="${VERSION/~*/}"
VERSION="${VERSION/^*/}"
if [ "$B" != "origin/master" ] ; then
THISBRANCH="${B/remotes\/origin\/linux-/}"
THISBRANCH="${THISBRANCH/.y/}"
REVISION="${THISBRANCH/*./}"
MAJORMINOR="${THISBRANCH/.${REVISION}/}"
let REVISION=REVISION+1
NEXTBRANCH="${MAJORMINOR}.${REVISION}"
fi
if [ -z "$LASTFIXEDBRANCH" ] ; then
WHITEBOARD="$WHITEBOARD [linux <${VERSION}]"
else
if [ "${LASTFIXEDBRANCH}" == "${VERSION/-rc*/}" ] ; then
WHITEBOARD="${WHITEBOARD} ${BAD}[linux >= \
${LASTFIXEDBRANCH} <${VERSION}]${NORMAL}"
else
WHITEBOARD="${WHITEBOARD} [linux >= \
${LASTFIXEDBRANCH} <${VERSION}]"
fi
fi
LASTFIXEDBRANCH=$NEXTBRANCH
KNOWNCOMMITS="$KNOWNCOMMITS $C"
fi
done
done
echo -e "${GOOD}Whiteboard${NORMAL}\n${WHITEBOARD:1}\n"
|