]> git.ozlabs.org Git - next-scripts/blob - make_tree_file
Update because I moved the next refs
[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 # This means I get the right tag if I finish after midnight
11 d=$(date --date "5 hours ago" '+%Y%m%d')
12
13 mkdir Next
14
15 echo 'Trees included into this release:
16
17 Name            Type    URL
18 ----            ----    ---' > Next/Trees
19
20 echo 'Name              SHA1
21 ----            ----' > Next/SHA1s
22
23 IFS='   '
24 while read email type name url ref build; do
25         [[ "$email" =~ '^#.*$' ]] && continue
26         tab="\t"
27         [ $(echo "$name" | wc -c) -le 8 ] && tab="\t\t"
28         [ "$type" = "git" ] && url="$url#$ref"
29         printf "%s$tab%s\t%s\n" $name $type $url
30         href="$name/$ref"
31         [ "$type" = "quilt" ] && href="quilt/$name"
32         printf "%s$tab%s\n" $name $(git show-ref --verify --hash "refs/next/$d/$name") >> Next/SHA1s
33 done <../real_control >>Next/Trees
34
35 for i in quilt-import.log merge.log; do
36         grep -v '^Checking out files:' ../$i >Next/$i
37 done
38
39 printf -- "-next-%s\n" $d >localversion-next
40
41 git add Next localversion-next
42 git commit -s -v -a -m "Add linux-next specific files for $d"
43 git tag "next-$d"
44 git update-ref refs/heads/stable refs/remotes/origin/master
45
46 # Stitch the new tree into the history branch
47 new_ref=$(echo "next-$d" | git commit-tree 'HEAD^{tree}' -p history -p HEAD)
48 git update-ref -m "next-$d" refs/heads/history $new_ref
49
50 ../tools/make_abat_scripts "$d"
51
52 exit 0