Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bump_hp: a nice script to bump haskell packages

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
commit 14dce60c78ee0ad1266f056b2a9807009152b8fa 1 parent 466bdb6
Sergei Trofimovich authored

Showing 1 changed file with 51 additions and 0 deletions. Show diff stats Hide diff stats

  1. +51 0 bin/bump_hp
51 bin/bump_hp
... ... @@ -0,0 +1,51 @@
  1 +#!/bin/bash
  2 +
  3 +die() {
  4 + echo "ERROR: $@"
  5 + exit 1
  6 +}
  7 +
  8 +run() {
  9 + echo "$@"
  10 + "$@" || die "$?"
  11 +}
  12 +
  13 +usage() {
  14 + echo "usage: $0 <pv | --auto> [rm-files...]"
  15 + echo "example: go to dev-haskell/tls and run:"
  16 + echo " $0 --auto *.ebuild"
  17 + die "no args"
  18 +}
  19 +
  20 +get_latest() {
  21 + local pn=$1
  22 + local r=
  23 + while read p; do
  24 + # pkg ver
  25 + set -- ${p}
  26 + [[ ${1,,} == ${pn} ]] && r=${2}
  27 + done < <(cabal list "${pn}" --simple-output)
  28 + [[ -n ${r} ]] || die "failed to find latest version for '${pn}'"
  29 + echo "${r}"
  30 +}
  31 +
  32 +pn=$(basename $(pwd))
  33 +c=$(basename $(dirname $(pwd)))
  34 +
  35 +pv=$1; shift
  36 +[[ -z ${pv} ]] && usage
  37 +[[ ${pv} == --auto ]] && pv=$(get_latest "${pn}")
  38 +
  39 +run hackport merge "$pn"
  40 +run ebuild "${pn}-${pv}.ebuild" clean install
  41 +
  42 +for rmpv in "$@"; do
  43 + run rm "${rmpv}"
  44 +done
  45 +
  46 +c=$(basename "$(dirname "$(pwd)")")
  47 +
  48 +run repoman manifest
  49 +run git add .
  50 +run git commit -s -m "${c}/${pn}: bump up to ${pv}" .
  51 +run git show -C -M

0 comments on commit 14dce60

Please sign in to comment.
Something went wrong with that request. Please try again.