diff options
-rwxr-xr-x | sources/master/update.sh | 22 | ||||
-rwxr-xr-x | sources/update_all.sh | 3 |
2 files changed, 16 insertions, 9 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." diff --git a/sources/update_all.sh b/sources/update_all.sh index db1fa56..fd698b8 100755 --- a/sources/update_all.sh +++ b/sources/update_all.sh @@ -34,7 +34,7 @@ DATECMD='date +%Y-%m-%dT%H:%M:%S' DIR=$1 if [ "x" = "x$DIR" ]; then - echo "Usage: update.sh DIR" + echo "Usage: update_all.sh DIR" exit 1 fi @@ -80,6 +80,7 @@ done echo "Running bzip2..." bzip2 -9 -c $DIR/taginfo-master.db >$DIR/download/taginfo-master.db.bz2 +bzip2 -9 -c $DIR/taginfo-search.db >$DIR/download/taginfo-search.db.bz2 echo "Done." echo "=====================================" |