the git-rcsimport wrapper
authorGeoffrey Thomas <geofft@mit.edu>
Tue, 3 Mar 2009 00:07:36 +0000 (19:07 -0500)
committerGeoffrey Thomas <geofft@mit.edu>
Tue, 3 Mar 2009 00:07:40 +0000 (19:07 -0500)
Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
git-rcsimport [new file with mode: 0755]

diff --git a/git-rcsimport b/git-rcsimport
new file mode 100755 (executable)
index 0000000..80714d8
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+# This is a trivial wrapper around git-cvsimport.
+
+dir="$1"
+shift
+if [ -z "$dir" ]; then
+  echo "Usage: git-rcsimport path/to/dir"
+  exit 1
+fi
+if [ ! -d "$dir/RCS" ]; then
+  echo "$dir/RCS does not exist."
+  exit 1
+fi
+
+tmpdir=`mktemp -d`
+mkdir "$tmpdir/CVSROOT"
+mkdir "$tmpdir/locks"
+echo "LockDir=$tmpdir/locks" > "$tmpdir/CVSROOT/config"
+ln -s "`readlink -f "$dir"`/RCS" "$tmpdir/RCS"
+CVSROOT="$tmpdir" git cvsimport RCS "$@"
+rm "$tmpdir/RCS" # a bit paranoid about rm -r's competence
+rm -r "$tmpdir"