annotate mkmaterialinfo.sh @ 1:38fb549a8b93

Added missing file.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 02 Jan 2016 18:12:02 +0200
parents c4f3b5b88891
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #!/bin/sh
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 DATADIR="data"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 DESTDIR="."
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 LISTLONG="$DESTDIR/materials_long.txt"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 LISTSHORT="$DESTDIR/materials_short.txt"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 LISTCSV="$DESTDIR/materials.csv"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 LISTPHP="$DESTDIR/materials.inc.php"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 LISTMAT="$DESTDIR/materials.pm"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 # Create the long list
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 echo "Generating long list..."
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 echo -n "Last updated: " > "$LISTLONG"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 date >> "$LISTLONG"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 echo "" >> "$LISTLONG"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 cat $DATADIR/*.mat | perl -w parsematerial.pl -dump >> "$LISTLONG"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 # Create the short and CSV lists
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 echo "Generating short list"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 echo -n "Last updated: " > "$LISTSHORT"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 date >> "$LISTSHORT"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 echo "" >> "$LISTSHORT"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 cat $DATADIR/*.mat | perl -w parsematerial.pl -table >> "$LISTSHORT"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 echo "Generating CSV"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 cat $DATADIR/*.mat | perl -w parsematerial.pl -csv > "$LISTCSV"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 echo "Generating PHP ..."
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 cat $DATADIR/*.mat | perl -w parsematerial.pl -php > "$LISTPHP"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 echo "Generating Perl data ..."
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 cat $DATADIR/*.mat | perl -w parsematerial.pl -perl > "$LISTMAT"
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 echo "Uploading ..."
c4f3b5b88891 Import material and alloy stuff into new repository.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 scp -C "$LISTLONG" "$LISTSHORT" "$LISTCSV" "$LISTPHP" ccr@tnsp.org:/var/www/tnsp.org/mat/