makerelease.sh 720 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. basedir="$(realpath -e "$0" | xargs dirname)"
  3. srcdir="$basedir/.."
  4. die() { echo "$*"; exit 1; }
  5. # Import the makerelease.lib
  6. # https://bues.ch/cgit/misc.git/plain/makerelease.lib
  7. for path in $(echo "$PATH" | tr ':' ' '); do
  8. [ -f "$MAKERELEASE_LIB" ] && break
  9. MAKERELEASE_LIB="$path/makerelease.lib"
  10. done
  11. [ -f "$MAKERELEASE_LIB" ] && . "$MAKERELEASE_LIB" || die "makerelease.lib not found."
  12. hook_get_version()
  13. {
  14. local file="$1/partmgr/core/version.py"
  15. local maj="$(cat "$file" | grep -e VERSION_MAJOR | head -n1 | awk '{print $3;}')"
  16. local min="$(cat "$file" | grep -e VERSION_MINOR | head -n1 | awk '{print $3;}')"
  17. version="$maj.$min"
  18. }
  19. project=partmgr
  20. default_archives=py-sdist-xz
  21. makerelease "$@"