[dune-common] 01/13: debian/get-orig-source: convert to git

Ansgar Burchardt ansgar at moszumanska.debian.org
Fri Dec 27 19:59:11 UTC 2013


This is an automated email from the git hooks/post-receive script.

ansgar pushed a commit to branch master
in repository dune-common.

commit 572054369c6019f3f77220a2e601fe86e5ffcd1a
Author: Ansgar Burchardt <ansgar at debian.org>
Date:   Fri Dec 27 16:29:22 2013 +0100

    debian/get-orig-source: convert to git
---
 debian/get-orig-source | 42 ++++++++++++++++++++++++++++++------------
 1 file changed, 30 insertions(+), 12 deletions(-)

diff --git a/debian/get-orig-source b/debian/get-orig-source
index 40e0cf0..79ab9f5 100755
--- a/debian/get-orig-source
+++ b/debian/get-orig-source
@@ -13,13 +13,16 @@ 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)
+  tree:    branch (default: master)
   rev:     revision number
 
   options:
-  --snapshot: SVN revision is appended to the version number
+  --snapshot: date and Git revision is appended to the version number
   --dch:      run dch to update version number
-  -d <dir>:   create orig tarball in directory <dir>"
+  -d <dir>:   create orig tarball in directory <dir>
+
+  environment:
+  DUNE_SOURCE path to DUNE repositories"
   exit 1
 }
 
@@ -27,6 +30,14 @@ if [[ $# -lt 2 ]]; then
   usage
 fi
 
+if [[ -z "${DUNE_SOURCE:-}" ]]; then
+  echo "DUNE_SOURCE is not set" >&2
+  echo "----------------------" >&2
+  echo "Please set DUNE_SOURCE to a directory containing" >&2
+  echo "checkouts of the DUNE modules to avoid cloning them." >&2
+  exit 1
+fi
+
 snapshot=
 dch=
 dir=.
@@ -42,16 +53,22 @@ done
 
 module="$1"
 version="$2"
-branch="${3:-trunk}"
-rev="${4:-}"
+branch="${3:-master}"
+if [[ -d "${DUNE_SOURCE}/${module}.git" ]]; then
+  GIT_DIR="${DUNE_SOURCE}/${module}.git"
+elif [[ -d "${DUNE_SOURCE}/${module}/.git" ]]; then
+  GIT_DIR="${DUNE_SOURCE}/${module}/.git"
+else
+  echo "Could not find Git repository for ${module} in ${DUNE_SOURCE}" >&2
+  exit 1
+fi
 
-url="https://svn.dune-project.org/svn/$module/$branch"
+export GIT_DIR
 
 if [[ $snapshot ]]; then
-  if [[ -z $rev ]]; then
-    rev="$(svn info "$url" | awk '/^Last Changed Rev:/ { print $4 }')"
-  fi
-  version="${version}svn$rev"
+  rev="$(git rev-parse --short ${branch})"
+  date="$(date +%Y%m%d)"
+  version="${version}${date}g${rev}"
 fi
 
 origdir="$module-$version.orig"
@@ -62,7 +79,8 @@ if [[ -e "$origdir" || -e "$tarball" ]]; then
   exit 1
 fi
 
-svn export ${rev:+-r $rev} "$url" "$origdir"
+mkdir "${origdir}"
+git archive --format=tar ${branch} | tar -C "${origdir}" -x
 cd "$origdir"
 case "$module" in
   dune-grid)
@@ -71,7 +89,7 @@ case "$module" in
 esac
 cd ..
 
-tar c "$origdir" | xz > "$tarball"
+tar --owner=root --group=root -c "$origdir" | xz -9 > "$tarball"
 rm -rf "$origdir"
 
 if [[ $dch ]]; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/dune-common.git



More information about the debian-science-commits mailing list