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