return $b;
}
+sub _config_del {
+ my $path = shift;
+
+ _debug("config: removing %s", join('.', @{$path}));
+ $remote_api->{config_del}->($path);
+}
+
#
# The _config_list_* are helper functions taking a path to a comma separated
# string. The string is interpreted as a list and the action performed
return;
}
- unless (_config_list_has(['defined-connectors'])) {
+ unless (_config_list_has(['defined-connectors'], $name)) {
_io("Connector does not exist");
return;
}
my $g;
my $m;
my $p;
+ my $skip;
# Look if we should ignore this line
($m, $p) = $g->get($message);
while (defined($m)) {
_debug('Metadata: %s', Dumper($m));
+ $skip = 0;
if (exists($remote_api->{link_callback})) {
- $remote_api->{link_callback}->($m);
+ $skip = $remote_api->{link_callback}->($m);
}
- if ('download' eq _config_get(['mode'])) {
- _io(
- sprintf('%s>>> %sSaving %s%%s%s %s%%s',
- _colorpair('*red'),
- _colorpair(),
- _colorpair('*yellow'),
- _colorpair(),
- _colorpair('*green'),
- ),
- $m->{'SOURCE'},
- $m->{'TITLE'}
- );
- unless($getter->get($m)) {
- _io(sprintf('%s>>> FAILED', _colorpair('*red')));
+ unless($skip) {
+ if ('download' eq _config_get(['mode'])) {
+ _io(
+ sprintf('%s>>> %sSaving %s%%s%s %s%%s',
+ _colorpair('*red'),
+ _colorpair(),
+ _colorpair('*yellow'),
+ _colorpair(),
+ _colorpair('*green'),
+ ),
+ $m->{'SOURCE'},
+ $m->{'TITLE'}
+ );
+ unless($getter->get($m)) {
+ _io(sprintf('%s>>> FAILED', _colorpair('*red')));
+ }
+ } elsif ('display' eq _config_get(['mode'])) {
+ _io(
+ sprintf('%s>>> %sSaw %s%%s%s %s%%s',
+ _colorpair('*magenta'),
+ _colorpair(),
+ _colorpair('*yellow'),
+ _colorpair(),
+ _colorpair('*green')
+ ),
+ $m->{'SOURCE'},
+ $m->{'TITLE'}
+ );
+ } else {
+ _io(sprintf('%s>>> Invalid operation mode', _colorpair('*red')));
}
- } elsif ('display' eq _config_get(['mode'])) {
- _io(
- sprintf('%s>>> %sSaw %s%%s%s %s%%s',
- _colorpair('*magenta'),
- _colorpair(),
- _colorpair('*yellow'),
- _colorpair(),
- _colorpair('*green')
- ),
- $m->{'SOURCE'},
- $m->{'TITLE'}
- );
- } else {
- _io(sprintf('%s>>> Invalid operation mode', _colorpair('*red')));
}
# Remove the matched part from the message and try again (there may be