git://git.camperquake.de
/
videosite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix quoting in AsyncWgetFileGetter again
[videosite.git]
/
libvideosite.pm
diff --git
a/libvideosite.pm
b/libvideosite.pm
index
34191b8
..
f9959bf
100644
(file)
--- a/
libvideosite.pm
+++ b/
libvideosite.pm
@@
-52,7
+52,12
@@
my $defaultconfig = {
'name' => 'direct',
'_immutable' => '1',
'schemas' => {},
'name' => 'direct',
'_immutable' => '1',
'schemas' => {},
- }
+ },
+ 'environment' => {
+ 'name' => 'environment',
+ '_immutable' => '1',
+ 'schemas' => {},
+ },
},
'config-version' => '2',
};
},
'config-version' => '2',
};
@@
-73,6
+78,7
@@
my $remote_api = {
module_path => sub { return dirname(realpath($0)) },
quote => sub { return $_ },
reload => sub {},
module_path => sub { return dirname(realpath($0)) },
quote => sub { return $_ },
reload => sub {},
+ wait_for_child => sub {},
};
#
};
#
@@
-86,7
+92,7
@@
my $videosite_commands = {
'set' => sub {
_cmd_set(@_);
},
'set' => sub {
_cmd_set(@_);
},
-
+
'show' => sub {
_cmd_show(@_);
},
'show' => sub {
_cmd_show(@_);
},
@@
-127,8
+133,8
@@
my $videosite_commands = {
_cmd_nodebug(@_);
},
_cmd_nodebug(@_);
},
- '
cach
e' => sub {
- _cmd_
cach
e(@_);
+ '
servic
e' => sub {
+ _cmd_
servic
e(@_);
},
};
},
};
@@
-271,6
+277,7
@@
sub _ploader {
config_get => \&_config_get,
config_set => \&_config_set,
config_has => \&_config_has,
config_get => \&_config_get,
config_set => \&_config_set,
config_has => \&_config_has,
+ wait_for_child => $remote_api->{wait_for_child},
});
} else {
_io('%s has wrong type (got %s, expected %s)', $p, $g->{'TYPE'}, $type);
});
} else {
_io('%s has wrong type (got %s, expected %s)', $p, $g->{'TYPE'}, $type);
@@
-279,7
+286,7
@@
sub _ploader {
}
_debug("Loaded %d plugins", $#g+1);
}
_debug("Loaded %d plugins", $#g+1);
-
+
return @g;
}
return @g;
}
@@
-385,7
+392,7
@@
sub _config_list_add {
_config_set($path, join(',', @c));
}
_config_set($path, join(',', @c));
}
-#
+#
# Remove an item from the list
#
sub _config_list_del {
# Remove an item from the list
#
sub _config_list_del {
@@
-931,9
+938,24
@@
sub _cmd_nodebug {
}
#
}
#
+# Handle generic service commands
+#
+sub _cmd_service {
+ my $event = shift;
+ my $subcmd = shift || '';
+
+ $subcmd = lc($subcmd);
+
+ if ($subcmd eq 'cache') {
+ _cmd_service_cache($event, @_);
+ }
+}
+
+
+#
# Display or clear the content of the config cache
#
# Display or clear the content of the config cache
#
-sub _cmd_cache {
+sub _cmd_
service_
cache {
my $event = shift;
my $subcmd = shift;
my $event = shift;
my $subcmd = shift;
@@
-944,14
+966,14
@@
sub _cmd_cache {
_io("Content of config cache:");
foreach (sort(keys(%config_cache))) {
if (exists($config_cache{$_}->{value})) {
_io("Content of config cache:");
foreach (sort(keys(%config_cache))) {
if (exists($config_cache{$_}->{value})) {
- _io("%s => %s", $_, $config_cache{$_}->{value});
+ _io("
%s => %s", $_, $config_cache{$_}->{value});
} else {
} else {
- _io("%s present", $_);
+ _io("
%s present", $_);
}
}
} elsif ($subcmd eq 'clear') {
}
}
} elsif ($subcmd eq 'clear') {
- _debug("Clearing config cache");
%config_cache = ();
%config_cache = ();
+ _io("Cache cleared");
}
}
}
}