[SCM] Packaging for dune-common: a toolbox for solving PDEs -- basic classes branch, master, updated. debian/2.2.svn6573-0.ab1-9-g56aa218
Ansgar Burchardt
ansgar at debian.org
Sat Mar 17 16:39:45 UTC 2012
The following commit has been merged in the master branch:
commit dc41bf5152f824b1335acd024d7ff8ba96a484c8
Author: Ansgar Burchardt <ansgar at debian.org>
Date: Sat Mar 17 13:25:13 2012 +0100
Add get-orig-source script.
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..40e0cf0
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,79 @@
+#! /bin/bash
+#
+# get-orig-source for dune
+#
+# (C) 2012, Ansgar Burchardt <ansgar at debian.org>
+# License: GPL-2 with DUNE exception
+
+set -e
+set -u
+set -o pipefail
+
+usage() {
+ echo "usage: get-orig-source [options...] <module> <version> [<tree>] [<rev>]
+ module: name of dune module (eg. dune-common)
+ version: upstream version number
+ tree: branch (default: trunk)
+ rev: revision number
+
+ options:
+ --snapshot: SVN revision is appended to the version number
+ --dch: run dch to update version number
+ -d <dir>: create orig tarball in directory <dir>"
+ exit 1
+}
+
+if [[ $# -lt 2 ]]; then
+ usage
+fi
+
+snapshot=
+dch=
+dir=.
+
+while :; do
+ case "$1" in
+ --snapshot) snapshot=1; shift ;;
+ --dch) dch=1; shift ;;
+ -d) dir="$2"; shift 2 ;;
+ *) break ;;
+ esac
+done
+
+module="$1"
+version="$2"
+branch="${3:-trunk}"
+rev="${4:-}"
+
+url="https://svn.dune-project.org/svn/$module/$branch"
+
+if [[ $snapshot ]]; then
+ if [[ -z $rev ]]; then
+ rev="$(svn info "$url" | awk '/^Last Changed Rev:/ { print $4 }')"
+ fi
+ version="${version}svn$rev"
+fi
+
+origdir="$module-$version.orig"
+tarball="$dir/${module}_$version.orig.tar.xz"
+
+if [[ -e "$origdir" || -e "$tarball" ]]; then
+ echo "source directory or tarball already exists" >&2
+ exit 1
+fi
+
+svn export ${rev:+-r $rev} "$url" "$origdir"
+cd "$origdir"
+case "$module" in
+ dune-grid)
+ find doc/grids/amiramesh -name "[a-z]*.am" -delete
+ ;;
+esac
+cd ..
+
+tar c "$origdir" | xz > "$tarball"
+rm -rf "$origdir"
+
+if [[ $dch ]]; then
+ dch --newversion "$version-1" "New upstream release ($version)."
+fi
--
Packaging for dune-common: a toolbox for solving PDEs -- basic classes
More information about the debian-science-commits
mailing list