Advertisement
Guest User

Untitled

a guest
May 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. set -eu
  4.  
  5. series=$1
  6.  
  7. source=$(dpkg-parsechangelog -SSource)
  8. version=$(dpkg-parsechangelog -SVersion)
  9. branch=$(git rev-parse --abbrev-ref HEAD)
  10.  
  11. if [ $(echo $branch | cut -d- -f1) != "merge" ]; then
  12. echo "wrong branch"
  13. exit 1
  14. fi
  15.  
  16. VER=$(echo $branch | cut -d- -f2)
  17. MAJOR=$(echo $VER | cut -d. -f1)
  18. MINOR=$(echo $VER | cut -d. -f2)
  19. OMINOR=$((MINOR-1))
  20.  
  21. P="$(echo -e '\033[01;32mnext command:\033[00m ')"
  22.  
  23. e () {
  24. q="$(printf " %q" "$@")"
  25. echo
  26. read -er -a n -i "${q# }" -p "$P"
  27. echo
  28. eval "${n[@]}"
  29. }
  30.  
  31. e git checkout -b $series-$MAJOR.$MINOR merge-$MAJOR.$MINOR
  32.  
  33. echo
  34.  
  35. for h in $(git rev-list --reverse merge-$MAJOR.$OMINOR..$series-$MAJOR.$OMINOR); do
  36. commit=$(git log -1 --pretty=format:%s $h)
  37. case "$commit" in
  38. releasing*|reconstruct*)
  39. break;;
  40. esac
  41. git cherry-pick --allow-empty $h || bash
  42. if git diff-tree --no-commit-id --name-only -r HEAD | grep -q ^debian/patches; then
  43. while ! quilt push -a; do
  44. bash
  45. done
  46. quilt refresh
  47. quilt pop -a
  48. if ! git diff --exit-code > /dev/null; then
  49. git commit --amend --no-edit --all
  50. fi
  51. fi
  52. done
  53.  
  54. git log --oneline merge-$MAJOR.$MINOR..HEAD
  55.  
  56. e dch -b -v $version~$(ubuntu-distro-info --series=$series --release | awk '{ print $1 }').1 '' --release-heuristic log -D UNRELEASED
  57. e git reconstruct-changelog merge-$MAJOR.$MINOR
  58. git diff
  59. e git commit -am reconstruct-changelog
  60. e rustbuild.sh --test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement