]> git.ozlabs.org Git - next-scripts/blob - make_tree_file
make_tree_file: use gpg-agent instead of ssh-agent
[next-scripts] / make_tree_file
1 #!/bin/bash
2
3 . "$(dirname $0)/common.sh"
4
5 # Don't do releases in the wee hours :-)
6 h=$(date '+%H')
7 (( "$h" < 10 && "$h" > 4 )) && {
8         echo "Go back to bed" 1>&2
9         exit 1
10 }
11
12 eval $(gpg-agent --daemon --enable-ssh-support)
13 ssh-add ~/.ssh/ra.kernel.org
14
15 # This means I get the right tag if I finish after midnight
16 d=$(date --date "5 hours ago" '+%Y%m%d')
17 l="$(git describe --match "v*" --abbrev=0)"
18 n="next-$d"
19
20 mkdir Next
21
22 echo 'Trees included into this release:
23
24 Name            Type    URL
25 ----            ----    ---' > Next/Trees
26
27 (
28 IFS='   '
29 while read email type name url ref build; do
30         [[ "$email" =~ '^#.*$' ]] && continue
31         tab="\t"
32         [ $(echo "$name" | wc -c) -le 8 ] && tab="\t\t"
33         [ "${ref%:*}" = "${ref}" ] || ref=${ref##*:}
34         [ "$type" = "git" ] && url="$url#$ref"
35         printf "%s$tab%s\t%s\n" $name $type $url >>Next/Trees
36 done <$CTRL_FILE
37 )
38
39 mv ../SHA1s Next/SHA1s
40
41 for i in quilt-import.log merge.log; do
42         grep -v '^Checking out files:' ../$i >Next/$i
43 done
44
45 printf -- "-next-%s\n" $d >localversion-next
46
47 git add Next localversion-next
48 git commit -s -v -a -m "Add linux-next specific files for $d"
49 git tag -u 41D5C07A -m "$n" "$n"
50
51 git branch -f stable refs/remotes/origin/master
52
53 p="patch-$l-$n"
54 git diff-tree -p "$l.." >"../$p"
55 gpg2 -u 41D5C07A -a -b "../$p"
56 #echo "$l" > "../LATEST-IS-$n"
57
58 "$bin_dir/make_abat_scripts" "$d" "$l"
59
60 oldest=$(date --date "3 months ago" '+%Y%m%d')
61 echo "Removing old releases ... <= next-$oldest"
62
63 old_tags=$(git ls-remote --tags korg next-\* |
64         awk -F - '$2 ~ /^[0-9]*$/ && $2 <= '$oldest' { printf("next-%s\n", $2); }')
65
66 [ "$old_tags" ] && git push korg --delete $old_tags
67
68 echo Pushing to korg ...
69 git push korg
70
71 echo Pushing to korg-history ...
72 git push korg-history
73
74 echo Pushing to history
75 git push history
76
77 echo Pushing patch to kernel.org ...
78 cd ..
79 xz -v -9 "$p"
80 kup --host=kup.kernel.org put "$p.xz" "$p.asc" "/pub/linux/kernel/next/$p.gz"
81
82 ssh-agent -k
83
84 exit 0