Skip to content

Commit

Permalink
bs_publish: add regex support in publishedhook
Browse files Browse the repository at this point in the history
Adds support for regular expressions in $BSConfig::publishedhook.
Usage is configurable with $BSConfig::publishedhook_use_regex.
  • Loading branch information
cschneemann authored and adrianschroeter committed Sep 26, 2012
1 parent 6a03934 commit f571e5c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/backend/bs_publish
Original file line number Diff line number Diff line change
Expand Up @@ -1569,8 +1569,19 @@ publishprog_done:
}
}

# support for regex usage in $BSConfig::publishedhook
my $publish_prp = $prp;
if ($BSConfig::publishedhook_use_regex) {
for my $key (keys %BSConfig::publishedhook) {
if ($prp =~ /$key/) {
$publish_prp = $key;
last;
}
}
}

if ($BSConfig::publishedhook && $BSConfig::publishedhook->{$prp}) {
qsystem($BSConfig::publishedhook->{$prp}, $prp, $extrep, @changed) && warn(" $BSConfig::publishedhook->{$prp} failed: $?");
qsystem($BSConfig::publishedhook->{$publish_prp}, $prp, $extrep, @changed) && warn(" $BSConfig::publishedhook->{$publish_prp} failed: $?");
}


Expand Down

0 comments on commit f571e5c

Please sign in to comment.