[Pkg-haskell-commits] darcs: tools: Use uscan to find out newest upstream version (duh)

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


Sun Apr  3 08:53:28 UTC 2011  Joachim Breitner <mail at joachim-breitner.de>
  * Use uscan to find out newest upstream version (duh)
  Ignore-this: c6ffc0618b8bae0811fc8a18f5758320

    M ./pkg-haskell-uupdate -21 +10

Sun Apr  3 08:53:28 UTC 2011  Joachim Breitner <mail at joachim-breitner.de>
  * Use uscan to find out newest upstream version (duh)
  Ignore-this: c6ffc0618b8bae0811fc8a18f5758320
diff -rN -u old-tools/pkg-haskell-uupdate new-tools/pkg-haskell-uupdate
--- old-tools/pkg-haskell-uupdate	2011-04-03 08:58:01.346659179 +0000
+++ new-tools/pkg-haskell-uupdate	2011-04-03 08:58:01.350659390 +0000
@@ -48,32 +48,21 @@
   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
+cd $PACKAGE-debian
 
 if [ -z "$VERSION" ]
 then
-  echo "No version number given or found, aborting"
-  exit 1
+  UPSTREAM_VERSION="$(uscan --dehs --upstream-version 0 --watchfile watch --package $PACKAGE --report-status|xpath -e 'dehs/upstream-version/text()' -q)"
+  if [ -n "$UPSTREAM_VERSION" ]
+  then 
+    VERSION="$UPSTREAM_VERSION-1"
+    echo "Detected Version number $VERSION."
+  else
+    echo "could not detect version."
+    exit 1
+  fi
 fi
 
-cd $PACKAGE-debian
 debchange --changelog changelog --newversion="$VERSION" 'New upstream release'
 debcommit
 darcs push -av





More information about the Pkg-haskell-commits mailing list