prepare-release 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/^Version: //p')
  3. DISTRIBUTION=$(dpkg-parsechangelog | sed -n -e '/^Distribution:/s/^Distribution: //p')
  4. if [ "$1" = 'pre-export' ]; then
  5. if [ "$DISTRIBUTION" = 'sid' ]; then
  6. echo >&2 '»sid« is not a valid distribution. Replace it with »unstable« for you'
  7. sed -i -e 's/) sid; urgency=/) unstable; urgency=/' debian/changelog
  8. DISTRIBUTION='unstable'
  9. elif [ "$DISTRIBUTION" = 'UNRELEASED' ]; then
  10. echo >&2 'WARNING: Remember to change to a valid distribution for release'
  11. VERSION="$VERSION~$(date +%Y%m%d)"
  12. fi
  13. if [ "$(date +%Y-%m-%d)" != "$(grep --max-count=1 '^"POT-Creation-Date: .*\n"$' po/apt-all.pot | cut -d' ' -f 2)" -o \
  14. "$(date +%Y-%m-%d)" != "$(grep --max-count=1 '^"POT-Creation-Date: .*\n"$' doc/po/apt-doc.pot | cut -d' ' -f 2)" ]; then
  15. echo >&2 'POT files are not up-to-date. Execute »make update-po« for you…'
  16. make update-po
  17. fi
  18. sed -i -e "s/^PACKAGE_VERSION=\".*\"$/PACKAGE_VERSION=\"${VERSION}\"/" configure.in
  19. elif [ "$1" = 'post-build' ]; then
  20. if [ "$DISTRIBUTION" != "UNRELEASED" ]; then
  21. echo >&2 "REMEMBER: Tag this release with »bzr tag ${VERSION}« if you are satisfied"
  22. else
  23. echo >&2 'REMEMBER: Change to a valid distribution before release'
  24. fi
  25. else
  26. echo >&1 "Usage:\t$0 pre-export
  27. \t$0 post-build
  28. If you use »bzr builddeb« you can leave this script alone as it will
  29. be run at the right places auto-magically. Otherwise you should use
  30. »pre-export« to update po and pot files as well as version numbering.
  31. »post-build« can be used to run some more or less useful checks later on."
  32. fi