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