summaryrefslogtreecommitdiff
path: root/util/vndb-dev-server.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-07-25 14:30:04 +0200
committerYorhel <git@yorhel.nl>2019-07-25 14:36:21 +0200
commitf296495a912ce759df11c43e78b4552788bdbff2 (patch)
tree0c10802de65fb7c8475722e12234bff5eb980628 /util/vndb-dev-server.pl
parent0f3cfeb85caec6424bcbea47142eefbf8011636b (diff)
Merge the v3 branch into separate namespace + fix Docker stuff (again)
I was getting tired of having to keep two branches up-to-date with the latest developments, so decided to throw v3 into the same branch - just different files (...which will get mostly rewritten again soon). The two versions aren't very different in terms of dependencies, build system and support code, so they can now properly share files. Added a section to the README to avoid confusion. This merge also makes it easier to quickly switch between the different versions, which is handy for development. It's even possible to run both at the same time, but my scripts use the same port so that needs a workaround. And it's amazing how often I break the Docker scripts.
Diffstat (limited to 'util/vndb-dev-server.pl')
-rwxr-xr-xutil/vndb-dev-server.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/util/vndb-dev-server.pl b/util/vndb-dev-server.pl
index 763748b6..bc23997a 100755
--- a/util/vndb-dev-server.pl
+++ b/util/vndb-dev-server.pl
@@ -15,6 +15,8 @@ use Cwd 'abs_path';
my $listen_port = $ENV{TUWF_HTTP_SERVER_PORT} || 3000;
$ENV{TUWF_HTTP_SERVER_PORT} = $listen_port+1;
+my $script = $ARGV[0] && $ARGV[0] eq '3' ? 'vndb3.pl' : 'vndb.pl';
+
my($pid, $prog, $killed);
sub prog_start {
@@ -28,7 +30,7 @@ sub prog_start {
}
print $d;
};
- $prog = run_cmd "$ROOT/util/vndb.pl",
+ $prog = run_cmd "$ROOT/util/$script",
'$$' => \$pid,
'>' => $output,
'2>' => $output;
@@ -102,7 +104,9 @@ sub checkmod {
chdir $ROOT;
$check->($_) for (qw{
util/vndb.pl
+ util/vndb3.pl
data/config.pl
+ data/config3.pl
data/global.pl
});
@@ -150,6 +154,6 @@ while(1) {
my $prog_conn = AE::cv;
tcp_connect '127.0.0.1', $ENV{TUWF_HTTP_SERVER_PORT}, sub { $prog_conn->send(shift); };
- my $prog_fh = $prog_conn->recv || die "Unable to connect to vndb.pl? $!";
+ my $prog_fh = $prog_conn->recv || die "Unable to connect to $script? $!";
pipe_fhs($serv_fh, $prog_fh);
}