Skip to content

Commit

Permalink
[backend] bs_publish: unpublished hook added
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Benk authored and Karsten Keil committed Aug 12, 2016
1 parent 53c1a82 commit cc48058
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/backend/bs_publish
Expand Up @@ -2135,6 +2135,23 @@ publishprog_done:
}
}

# support for regex usage in $BSConfig::unpublishedhook
my $unpublish_prp = $prp;
if ($BSConfig::unpublishedhook_use_regex || $BSConfig::unpublishedhook_use_regex) {
for my $key (sort {$b cmp $a} keys %{$BSConfig::unpublishedhook}) {
if ($prp =~ /^$key/) {
$unpublish_prp = $key;
last;
}
}
}
if ($BSConfig::unpublishedhook && $BSConfig::unpublishedhook->{$unpublish_prp}) {
my $hook = $BSConfig::unpublishedhook->{$unpublish_prp};
$hook = [ $hook ] unless ref $hook;
print " calling unpublished hook @$hook\n";
qsystem(@$hook, $prp, $extrep, @db_deleted) && warn(" @$hook failed: $?\n");
}

# support for regex usage in $BSConfig::publishedhook
my $publish_prp = $prp;
if ($BSConfig::publishedhook_use_regex || $BSConfig::publishedhook_use_regex) {
Expand Down

0 comments on commit cc48058

Please sign in to comment.