aboutsummaryrefslogtreecommitdiff
path: root/sources/master
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-22 22:19:26 +0100
committerJochen Topf <jochen@topf.org>2013-01-22 22:19:26 +0100
commit12e8e3d3947065f5c6517ca67d96f8b83bdbd543 (patch)
treec45abfa8fe718e5a3da4f989520d6837d23590f3 /sources/master
parentcf2345f0b143f6164f6bf35ac168d64a52db1951 (diff)
downloadtaginfo-12e8e3d3947065f5c6517ca67d96f8b83bdbd543.tar
taginfo-12e8e3d3947065f5c6517ca67d96f8b83bdbd543.tar.gz
Use ruby instead of perl in master update script
Diffstat (limited to 'sources/master')
-rwxr-xr-xsources/master/update.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/sources/master/update.sh b/sources/master/update.sh
index 99d16b0..e90571d 100755
--- a/sources/master/update.sh
+++ b/sources/master/update.sh
@@ -16,21 +16,27 @@ if [ "x" = "x$DIR" ]; then
exit 1
fi
-echo "`$DATECMD` Create search database..."
-
-rm -f $DIR/taginfo-search.db
-perl -pe "s|__DIR__|$DIR|" search.sql | sqlite3 $DIR/taginfo-search.db
-
echo "`$DATECMD` Start master..."
+EXEC_RUBY="$TAGINFO_RUBY"
+if [ "x$EXEC_RUBY" = "x" ]; then
+ EXEC_RUBY=ruby
+fi
+echo "Running with ruby set as '${EXEC_RUBY}'"
+
DATABASE=$DIR/taginfo-master.db
+echo "`$DATECMD` Create search database..."
+
+rm -f $DIR/taginfo-search.db
+$EXEC_RUBY -pe "\$_.sub!(/__DIR__/, '$DIR')" search.sql | sqlite3 $DIR/taginfo-search.db
+
rm -f $DATABASE
sqlite3 $DATABASE <languages.sql
-perl -pe "s|__DIR__|$DIR|" master.sql | sqlite3 $DATABASE
-perl -pe "s|__DIR__|$DIR|" interesting_tags.sql | sqlite3 $DATABASE
-perl -pe "s|__DIR__|$DIR|" interesting_relation_types.sql | sqlite3 $DATABASE
+$EXEC_RUBY -pe "\$_.sub!(/__DIR__/, '$DIR')" master.sql | sqlite3 $DATABASE
+$EXEC_RUBY -pe "\$_.sub!(/__DIR__/, '$DIR')" interesting_tags.sql | sqlite3 $DATABASE
+$EXEC_RUBY -pe "\$_.sub!(/__DIR__/, '$DIR')" interesting_relation_types.sql | sqlite3 $DATABASE
echo "`$DATECMD` Done master."