X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=make_tree_file;h=75614f6bb80595c39b1944d1ca14e4f84f2985f0;hb=HEAD;hp=8a7549210510e0181b7d98a9c85f5af7711e57d8;hpb=e416fb0e4b08ebc9ef1dc994d0e9ec07fefbaa85;p=next-scripts diff --git a/make_tree_file b/make_tree_file index 8a75492..f286756 100755 --- a/make_tree_file +++ b/make_tree_file @@ -1,60 +1,84 @@ -#!/bin/bash +#!/bin/sh + +_next_common_no_args=1 . "$(dirname "$0")/common.sh" # Don't do releases in the wee hours :-) -h=$(date '+%H') -(( "$h" < 10 && "$h" > 4 )) && { - echo "Go back to bed" 1>&2 +h=$(date '+%k') +if [ "$h" -lt 10 ] && [ "$h" -gt 4 ]; then + printf '%s\n' 'Go back to bed' 1>&2 exit 1 -} +fi + +# This means I get the right tag if I finish after midnight +d=$(date --date '5 hours ago' '+%Y%m%d') +l=$(git tag -l --sort=taggerdate 'v*' | tail -n 1) +n="next-$d" mkdir Next -echo 'Trees included into this release: +( + tab="$_TAB$_TAB" -Name Type URL ----- ---- ---' > Next/Trees + printf '%s\n\n' 'Trees included into this release:' + printf '%s%s%s\t%s\n' 'Name' "$tab" 'Type' 'Url' + printf '%s%s%s\t%s\n' '----' "$tab" '----' '---' -echo 'Name SHA1 ----- ----' > Next/SHA1s + for name in $(get_branches); do + tab="$_TAB" + if [ ${#name} -lt 8 ]; then + tab="$tab$_TAB" + fi + type=$(get_type "$name") + url=$(get_url "$name") + if [ "$type" = "git" ] && ! [ "$url" = 'linux-next' ]; then + ref=$(get_remote_branch "$name") + url="$url#$ref" + fi + printf '%s%s%s\t%s\n' "$name" "$tab" "$type" "$url" + done +) >Next/Trees -IFS=' ' -while read email type name url ref build; 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 - href="$name/$ref" - [ "$type" = "quilt" ] && href="quilt/$name" - printf "%s$tab%s\n" $name $(git rev-parse --verify $href) >> Next/SHA1s -done <../real_control >>Next/Trees +mv ../SHA1s Next/SHA1s -cp ../quilt-import.log ../merge.log Next/. +grep -a -v '^Checking out files:' ../merge.log >Next/merge.log -# This means I get the right tag if I finish after midnight -d=$(date --date "5 hours ago" '+%Y%m%d') - -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 - -# 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 - -l=$(git describe --match "v*" --abbrev=0) -l=${l#v} -cat >../abat-script-$d <"../$p" +gpg -u "$kup_gpg_key" -a -b "../$p" + +oldest=$(date --date '3 months ago' '+%Y%m%d') +printf 'Removing old releases ... <= next-%s\n' "$oldest" + +for t in $(git tag -l 'next-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'); do + t=${t#next-} + if [ "$t" -gt "$oldest" ]; then + break + fi + git tag -d "next-$t" +done + +printf '%s\n' 'Pushing to korg ...' +git push --prune korg + +printf '%s\n' 'Pushing to korg-history ...' +git push korg-history + +printf '%s\n' 'Pushing to history ...' +git push history + +printf '%s\n' 'Pushing patch to kernel.org ...' +cd .. +xz -v -9 "$p" +kup put "$p.xz" "$p.asc" "/pub/linux/kernel/next/$p.gz" + +ssh -O exit git@gitolite.kernel.org exit 0