added scripts/{check-cvs-add,lib/Time/Zone.pm,log} to the scripts branch
[opensuse:kernel-source.git] / scripts / check-cvs-add
1 #! /bin/bash
2
3 #
4 # Check if all files referenced by series.conf are in the CVS.
5 #
6
7 . ${0%/*}/wd-functions.sh
8
9 if ! $using_git; then
10         exit 0
11 fi
12
13 export LANG=C
14
15 patches="$(scripts/guards --list < series.conf | sort -u)"
16
17 if [ "$1" = "--committed" ]; then
18     # check if patches and kabi files are committed
19     added="$(git ls-tree -r --name-only HEAD | grep '^patches\..*/' |
20              sort -u)"
21     not_in_git="$(join -v1 <(echo "$patches") <(echo "$added"))
22                 $(git ls-files -d -o -m --exclude-standard kabi/ | sort -u)"
23 else
24     # only if the patches are added
25     added="$(git ls-files --cached | grep '^patches\..*/' | sort -u)"
26     not_in_git="$(join -v1 <(echo "$patches") <(echo "$added"))"
27 fi
28
29 if [ -n "$not_in_git" ]; then
30     for patch in $not_in_git; do
31         if [ -e "$patch" ]; then
32             echo "Not in GIT: $patch" >&2
33             status=1
34         else
35             echo "Missing: $patch" >&2
36             status=1
37         fi
38     done
39     exit $status
40 fi