blob: ca5fc42796d42bfbb5aab3734682621643d31e40 [file]
#!/bin/bash -eu
base_ver="$1"
. "$(dirname "$0")"/lsq-defs
cd "$(get_git $base_ver)"
# Stash away changes applied through quilt
git add -f .pc
git stash save "quilted working tree for $(make kernelversion)"
# Re-apply them through git
git quiltimport --patches "$(get_queue $base_ver)"
full_version="$(next_update $(make kernelversion))"
old_IFS="$IFS"
IFS=.
set -- $full_version
IFS="$old_IFS"
sed -i "s/^SUBLEVEL =.*/SUBLEVEL = $3/; s/^EXTRAVERSION =.*/EXTRAVERSION =${4:+ .$4}/" Makefile
git commit -m "Linux $full_version" Makefile
# Check for unexpected changes
# XXX I want to filter out the version change here and then automatically fail
# if there's anything else, but can't work out how to do that yet.
echo "Changes from previous working tree:"
git diff stash@{0} HEAD | filterdiff -p1 -x '.pc/*' --clean
read -p "All good? " </dev/tty
case "$REPLY" in
y|yes)
git stash drop
;;
*)
echo Reverting...
{
git reset --hard stash@{0}^
git stash pop
git reset .pc
} >/dev/null
exit 1
;;
esac
git tag -s -m "This is the $full_version stable release" v$full_version
queue="$(get_queue $base_ver)"
cd "$(dirname "$queue")"
git mv "$(basename "$queue")" releases/$full_version
git commit -m "Release $full_version"