]> git.ozlabs.org Git - next-scripts/blobdiff - make_tree_file
do_stats: create the mail message as well
[next-scripts] / make_tree_file
index e25b0c5eae0b9a4ddf28dd3032aab8c095dca9a0..ecc6cbeff2b9347ebde6bc0c81339b518ebbb66b 100755 (executable)
@@ -1,42 +1,90 @@
 #!/bin/bash
 
+. "$(dirname $0)/common.sh"
+
 # Don't do releases in the wee hours :-)
-h=$(date '+%H')
+h=$(date '+%k')
 (( "$h" < 10 && "$h" > 4 )) && {
        echo "Go back to bed" 1>&2
        exit 1
 }
 
+# allow kisskb to use more of ka2
+ssh $build_host /usr/local/bin/set-kisskb-jfactor 48
+
+eval $(gpg-agent --daemon --enable-ssh-support)
+ssh-add $ssh_key_file || exit 1
+
+if ! ssh git@gitolite.kernel.org 2fa isval; then
+       read -r -p "Yubikey token: " tok
+       ssh git@gitolite.kernel.org 2fa val $tok
+fi
+
+# This means I get the right tag if I finish after midnight
+d=$(date --date "5 hours ago" '+%Y%m%d')
+l="$(git describe --match "v*" --abbrev=0)"
+n="next-$d"
+
 mkdir Next
 
-echo 'Trees included into this release:
+(
+       cat <<-'EOF'
+       Trees included into this release:
 
-Name           Type    URL
-----           ----    ---' > Next/Trees
+       Name            Type    URL
+       ----            ----    ---
+       EOF
 
-IFS='  '
-while read email type name url ref; do
-       [[ "$email" =~ '^#.*$' ]] && continue
-       tab="\t"
-       [ $(echo "$name" | wc -c) -le 8 ] && tab="\t\t"
-       [ "$type" = "git" ] && url="$url#$ref"
-       printf "%s$tab%s\t%s\n" $name $type $url
-done <../real_control >>Next/Trees
+       IFS='   '
+       grep -v '^#' $CTRL_FILE |
+               while read email type name url ref build; do
+                       tab="\t"
+                       [ ${#name} -le 8 ] && tab="\t\t"
+                       [ "$type" = "git" ] && url="$url#${ref##*:}"
+                       printf "%s$tab%s\t%s\n" $name $type $url
+               done
+) >Next/Trees
 
-cp ../quilt-import.log ../merge.log Next/.
+mv ../SHA1s Next/SHA1s
 
-# This means I get the right tag if I finish after midnight
-d=$(date --date "5 hours ago" '+%Y%m%d')
+for i in quilt-import.log merge.log; do
+       grep -v '^Checking out files:' ../$i >Next/$i
+done
 
-printf "%s-next-%s\n" "" $d >localversion-next
+printf -- "-next-%s\n" $d >localversion-next
 
 git add Next localversion-next
 git commit -s -v -a -m "Add linux-next specific files for $d"
-git tag "next-$d"
-git update-ref refs/heads/stable refs/remotes/origin/master
+git tag -u $gpg_key -m "$n" "$n"
+
+git branch -f stable refs/remotes/origin/master
+
+p="patch-$l-$n"
+git diff-tree -p "$l.." >"../$p"
+gpg2 -u $gpg_key -a -b "../$p"
+
+oldest=$(date --date "3 months ago" '+%Y%m%d')
+echo "Removing old releases ... <= next-$oldest"
+
+old_tags=$(git ls-remote --tags korg 'next-*[0-9]' |
+       awk -F - '$2 ~ /^[0-9]*$/ && $2 <= '$oldest' { printf("next-%s\n", $2); }')
+
+[ "$old_tags" ] && git push korg --delete $old_tags
+
+echo Pushing to korg ...
+git push korg
+
+echo Pushing to korg-history ...
+git push korg-history
+
+echo Pushing to history
+git push history
+
+echo Pushing patch to kernel.org ...
+cd ..
+xz -v -9 "$p"
+kup --host=kup.kernel.org put "$p.xz" "$p.asc" "/pub/linux/kernel/next/$p.gz"
 
-# Stitch the new tree into the history branch
-new_ref=$(echo "next-$d" | git commit-tree 'HEAD^{tree}' -p history -p HEAD)
-git update-ref -m "next-$d" refs/heads/history $new_ref
+ssh-agent -k
 
 exit 0