summaryrefslogtreecommitdiffstats
path: root/src/test/encoding/import.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/encoding/import.sh')
-rwxr-xr-xsrc/test/encoding/import.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/encoding/import.sh b/src/test/encoding/import.sh
new file mode 100755
index 000000000..eea96e353
--- /dev/null
+++ b/src/test/encoding/import.sh
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+src=$1
+ver=$2
+archive=$3
+
+[ -d "$archive" ] && [ -d "$src" ] || echo "usage: $0 <srcdir> <version> <archive>"
+
+[ -d "$archive/$ver" ] || mkdir "$archive/$ver"
+
+dest_dir="$archive/$ver/objects"
+
+[ -d "$dest_dir" ] || mkdir "$dest_dir"
+
+for f in `find $src -type f`
+do
+ n=`basename $f`
+ type=`echo $n | sed 's/__.*//'`
+ md=`md5sum $f | awk '{print $1}'`
+
+ [ -d "$dest_dir/$type" ] || mkdir $dest_dir/$type
+ [ -e "$dest_dir/$type/$md" ] || cp $f $dest_dir/$type/$md
+done