X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=make_tree_file;h=75614f6bb80595c39b1944d1ca14e4f84f2985f0;hb=HEAD;hp=48cb0f39bb745c61adb33bf5f9728c4dbc28695d;hpb=72507a26391c2b06e5ff2899c54e894ada5785c0;p=next-scripts diff --git a/make_tree_file b/make_tree_file index 48cb0f3..75614f6 100755 --- a/make_tree_file +++ b/make_tree_file @@ -1,72 +1,81 @@ #!/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 } -mkdir Next +read -r -p "Yubikey token: " tok +ssh git@gitolite.kernel.org 2fa val-session $tok -echo 'Trees included into this release: +# 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" -Name Type URL ----- ---- ---' > Next/Trees +mkdir Next -echo 'Name SHA1 ----- ----' > Next/SHA1s +( + cat <<-'EOF' + Trees included into this release: -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 - 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 + Name Type URL + ---- ---- --- + EOF -cp ../quilt-import.log ../merge.log Next/. + IFS=' ' + grep -v '^#' $CTRL_FILE | + while read email type name url ref build; do + [ "$type" = "branch" ] && continue + tab="\t" + [ ${#name} -lt 8 ] && tab="\t\t" + [ "$type" = "git" ] && url="$url#${ref##*:}" + printf "%s$tab%s\t%s\n" $name $type $url + done +) >Next/Trees -# This means I get the right tag if I finish after midnight -d=$(date --date "5 hours ago" '+%Y%m%d') +mv ../SHA1s Next/SHA1s -printf "%s-next-%s\n" "" $d >localversion-next +grep -v '^Checking out files:' ../merge.log >Next/merge.log + +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 - -# Create a patch to remove the localversion-next file -cat >../nolocalversion-$d.patch <../abat-script-$d <"../$p" +gpg -u $kup_gpg_key -a -b "../$p" + +oldest=$(date --date "3 months ago" '+%Y%m%d') +echo "Removing old releases ... <= next-$oldest" + +old_tags=$(git tag -l 'next-*[0-9]' | + awk -F - '$2 ~ /^[0-9]*$/ && $2 <= '$oldest' { printf("next-%s\n", $2); }') + +[ "$old_tags" ] && git tag -d $old_tags + +echo Pushing to korg ... +git push --prune 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 put "$p.xz" "$p.asc" "/pub/linux/kernel/next/$p.gz" + +ssh -O exit git@gitolite.kernel.org exit 0