cpt-extra

Extra utilities for cpt
git clone git://git.carbslinux.org/cpt-extra
Log | Files | Refs | README | LICENSE

cpt-rel (572B)


      1 #!/bin/sh -e
      2 # Bump the release number of a package
      3 
      4 case "$1" in
      5     '') set -- . ;;
      6     --help|-h) printf '%s\n' "usage: ${0##*/}"; exit 0; esac
      7 
      8 for pkg; do (
      9 
     10     cd "$pkg"
     11 
     12     read -r ver rel < version || {
     13         printf '%s\n' "could not find version file, are you on a package directory?"
     14         exit 1
     15     }
     16 
     17     # Update the version file with the new release number
     18     printf '%s\n' "$ver $(( rel += 1 ))" > version
     19 
     20     # Unstage all changes and add the version file
     21     git reset; git add version
     22     git commit -m "${PWD##*/}: bump release number"
     23 
     24 ) done