-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommit-adt-hints
More file actions
executable file
·61 lines (52 loc) · 1.04 KB
/
commit-adt-hints
File metadata and controls
executable file
·61 lines (52 loc) · 1.04 KB
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
#!/bin/bash -eu
#
# Commit a modified ADT hints config file
#
function usage()
{
cat <<EOF
Usage: $(basename "${0}") [-h] CONF
Commit a modified ADT hints config file.
Optional arguments:
-h, --help Show this help text and exit.
EOF
}
conf=
while [ ${#} -gt 0 ] ; do
case "${1}" in
-h|--help)
usage
exit
;;
*)
if [ -n "${conf}" ] ; then
echo "Invalid argument: ${1}" >&2
exit 2
fi
conf=${1}
;;
esac
shift
done
if [ -z "${conf}" ] ; then
usage
exit 2
fi
pkgs=
while IFS= read -r line ; do
readarray -t data < <(echo "${line}" | tr ' ' '\n')
series=${data[1]}
source=${data[2]}
source=${source#linux-meta}
source=${source#-}
if [ -z "${source}" ] ; then
source=linux
fi
version=${data[3]}
pkgs=${pkgs},${data[4]}
done < <(git diff "${conf}" | grep '^+result')
pkgs=${pkgs:1}
subject="${series::1}/${source}: hint ${pkgs} for ${version}"
git add "${conf}"
git commit -s -m "${subject}"
git show