[Pkg-haskell-commits] darcs: tools: Too to easily switch to a new upstream version

Joachim Breitner mail at joachim-breitner.de
Sun Apr 3 08:58:01 UTC 2011


Sun Apr  3 05:01:30 UTC 2011  Joachim Breitner <mail at joachim-breitner.de>
  * Too to easily switch to a new upstream version 
  Ignore-this: 5997e8b89e6561d2b2d09bcc86c10eed

    A ./pkg-haskell-uupdate

Sun Apr  3 05:01:30 UTC 2011  Joachim Breitner <mail at joachim-breitner.de>
  * Too to easily switch to a new upstream version 
  Ignore-this: 5997e8b89e6561d2b2d09bcc86c10eed
diff -rN -u old-tools/pkg-haskell-uupdate new-tools/pkg-haskell-uupdate
--- old-tools/pkg-haskell-uupdate	1970-01-01 00:00:00.000000000 +0000
+++ new-tools/pkg-haskell-uupdate	2011-04-03 08:58:01.086645456 +0000
@@ -0,0 +1,84 @@
+#!/bin/bash
+# Copyright (c) 2009 Marco Túlio Gontijo e Silva <marcot at holoscopio.com>
+#               2009-2011 Joachim Breitner <nomeata at debian.org>
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# Usage:
+# pkg-haskell-checkout [PACKAGE ...]
+
+set -e
+
+PACKAGE="$1"
+VERSION="$2"
+
+if [ -z "$PACKAGE" ]
+then
+  echo "Usage: $0 package [version]"
+fi
+
+if [ -e $PACKAGE-debian ]
+then
+  echo "Temporary directory $PACKAGE-debian already exists, aborting"
+  exit 1
+fi
+
+darcs get alioth.debian.org:/darcs/pkg-haskell/$PACKAGE $PACKAGE-debian
+
+if [ ! -e $PACKAGE-debian/control -o ! -e $PACKAGE-debian/changelog ]
+then
+  echo "Did not find PACKAGE-debian/control or $PACKAGE-debian/changelog."
+  echo "Is the repository in the debian/-only format?"
+  exit 1
+fi
+
+if [ -z "$VERSION" ]
+then
+  #Heuristics
+  CABAL_PACKAGE="$(cat $PACKAGE-debian/watch|grep hackage.haskell.org|cut -d/ -f6|cut -d\  -f1)"
+  if [ -n "$CABAL_PACKAGE" ]
+  then
+    echo "Using latest version of Hackage package $CABAL_PACKAGE..."
+    CABAL_VERSION="$(cabal info unix-compat|perl -n -e 'print $1 if /Latest version available: (.*)/')"
+    if [ -n "$CABAL_VERSION" ]
+    then 
+      VERSION="$CABAL_VERSION-1"
+      echo "detected Version number $VERSION."
+    else
+      echo "could not detect version."
+      exit 1
+    fi
+  fi
+fi
+
+if [ -z "$VERSION" ]
+then
+  echo "No version number given or found, aborting"
+  exit 1
+fi
+
+cd $PACKAGE-debian
+debchange --changelog changelog --newversion="$VERSION" 'New upstream release'
+debcommit
+darcs push -av
+cd ..
+
+rm -rf $PACKAGE-debian $WANTED_PACKAGEDIR/debian
+
+echo "Successfully updated $PACKAGE to $VERSION"





More information about the Pkg-haskell-commits mailing list