/usr/share/perl5/FCM/Context/Event.pm is in fcm 2016.12.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | #-------------------------------------------------------------------------------
# (C) British Crown Copyright 2006-16 Met Office.
#
# This file is part of FCM, tools for managing and building source code.
#
# FCM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FCM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FCM. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
use strict;
use warnings;
#-------------------------------------------------------------------------------
package FCM::Context::Event;
use base qw{FCM::Class::HASH};
use constant {
CM_ABORT => 'CM_ABORT',
CM_BRANCH_CREATE_SOURCE => 'CM_BRANCH_CREATE_SOURCE',
CM_BRANCH_LIST => 'CM_BRANCH_LIST',
CM_COMMIT_MESSAGE => 'CM_COMMIT_MESSAGE',
CM_CONFLICT_TEXT => 'CM_CONFLICT_TEXT',
CM_CONFLICT_TEXT_SKIP => 'CM_CONFLICT_TEXT_SKIP',
CM_CONFLICT_TREE => 'CM_CONFLICT_TREE',
CM_CONFLICT_TREE_SKIP => 'CM_CONFLICT_TREE_SKIP',
CM_CONFLICT_TREE_TIME_WARN => 'CM_CONFLICT_TREE_TIME_WARN',
CM_CREATE_TARGET => 'CM_CREATE_TARGET',
CM_LOG_EDIT => 'CM_LOG_EDIT',
#CM_WC_STATUS => 'CM_WC_STATUS',
#CM_WC_STATUS_PATH => 'CM_WC_STATUS_PATH',
CONFIG_OPEN => 'CONFIG_OPEN',
CONFIG_ENTRY => 'CONFIG_ENTRY',
CONFIG_VAR_UNDEF => 'CONFIG_VAR_UNDEF',
E => 'E',
EXPORT_ITEM_CREATE => 'EXPORT_ITEM_CREATE',
EXPORT_ITEM_DELETE => 'EXPORT_ITEM_DELETE',
FCM_VERSION => 'FCM_VERSION',
KEYWORD_ENTRY => 'KEYWORD_ENTRY',
OUT => 'OUT',
MAKE_BUILD_SHELL_OUT => 'MAKE_BUILD_SHELL_OUT',
MAKE_BUILD_SOURCE_ANALYSE => 'MAKE_BUILD_SOURCE_ANALYSE',
MAKE_BUILD_SOURCE_SUMMARY => 'MAKE_BUILD_SOURCE_SUMMARY',
MAKE_BUILD_TARGET_DONE => 'MAKE_BUILD_TARGET_DONE',
MAKE_BUILD_TARGET_FAIL => 'MAKE_BUILD_TARGET_FAIL',
MAKE_BUILD_TARGET_FROM_NS => 'MAKE_BUILD_TARGET_FROM_NS',
MAKE_BUILD_TARGET_MISSING_DEP => 'MAKE_BUILD_TARGET_MISSING_DEP',
MAKE_BUILD_TARGET_SELECT => 'MAKE_BUILD_TARGET_SELECT',
MAKE_BUILD_TARGET_SELECT_TIMER=> 'MAKE_BUILD_TARGET_SELECT_TIMER',
MAKE_BUILD_TARGET_STACK => 'MAKE_BUILD_TARGET_STACK',
MAKE_BUILD_TARGET_SUMMARY => 'MAKE_BUILD_TARGET_SUMMARY',
MAKE_BUILD_TARGET_TASK_SUMMARY=> 'MAKE_BUILD_TARGET_TASK_SUMMARY',
MAKE_BUILD_TARGETS_FAIL => 'MAKE_BUILD_TARGETS_FAIL',
MAKE_DEST => 'MAKE_DEST',
MAKE_EXTRACT_PROJECT_TREE => 'MAKE_EXTRACT_PROJECT_TREE',
MAKE_EXTRACT_RUNNER_SUMMARY => 'MAKE_EXTRACT_RUNNER_SUMMARY',
MAKE_EXTRACT_SYMLINK => 'MAKE_EXTRACT_SYMLINK',
MAKE_EXTRACT_TARGET => 'MAKE_EXTRACT_TARGET',
MAKE_EXTRACT_TARGET_SUMMARY => 'MAKE_EXTRACT_TARGET_SUMMARY',
MAKE_MIRROR => 'MAKE_MIRROR',
SHELL => 'SHELL',
TASK_WORKERS => 'TASK_WORKERS',
TIMER => 'TIMER',
};
__PACKAGE__->class({args => '@', code => '$'});
#-------------------------------------------------------------------------------
1;
__END__
=head1 NAME
FCM::Context::Event
=head1 SYNOPSIS
use FCM::Context::Event;
my $event_ctx = FCM::Context::Event->new($code, @args);
=head1 DESCRIPTION
An instance of this class represents the context of an event. This class is a
sub-class of L<FCM::Class::HASH|FCM::Class::HASH>.
=head1 ATTRIBUTES
=over 4
=item args
An ARRAY reference that represents the additional arguments/contexts of the
event.
=item code
The event code. See below
=back
=head1 EVENTS
The following is a list of event codes.
=over 4
=item FCM::Context::Event->CM_ABORT
This event is raised when a code management command aborts. The 1st argument
should be either "user" (user abort) or "null" (null command).
=item FCM::Context::Event->CM_BRANCH_CREATE_SOURCE
This event is raised to notify the source of a branch create. The 1st argument
should be the expected source URL, and the 2nd argument is the specified peg
revision.
=item FCM::Context::Event->CM_BRANCH_LIST
This event is raised when doing a branch listing. The 1st argument should be the
project location and the rest of the arguments are the branches discovered.
=item FCM::Context::Event->CM_COMMIT_MESSAGE
This event is raised to notify the user the log message to be used for a commit.
The 1st argument of the event should be an instance of
FCM::System::CM::CommitMessage::State.
=item FCM::Context::Event->CM_CONFLICT_TEXT
This event is raised to notify the path of a file with a text conflict.
=item FCM::Context::Event->CM_CONFLICT_TEXT_SKIP
This event is raised to notify the path of a file with a text conflict that
cannot be resolved using a merge tool. E.g. it may be a binary file.
=item FCM::Context::Event->CM_CONFLICT_TREE
This event is raised to notify the path of a node with a tree conflict.
=item FCM::Context::Event->CM_CONFLICT_TREE_SKIP
This event is raised to notify the path of a node with a tree conflict that
cannot be resolved automatically under current functionality. For example, it
may be a directory containing multiple conflicts.
=item FCM::Context::Event->CM_CREATE_TARGET
This event is raised to notify the target of a newly created URL. The 1st argument
should be the target URL.
=item FCM::Context::Event->CM_LOG_EDIT
This event is raised before the system launches an editor to edit a commit log
message. The 1st argument of the event should be the editor command.
=item FCM::Context::Event->CONFIG_ENTRY
This entry is raised to notify the reading of a configuration file entry. The
1st argument should be a blessed reference of a
L<FCM::Context::ConfigEntry|FCM::Context::ConfigEntry>. The second argument
should be a boolean flag to indicate whether this entry is in FCM 1 format or
not.
=item FCM::Context::Event->CONFIG_OPEN
This event is raised when a new configuration file is opened for reading. The
1st argument of this event is an ARRAY that represents the include file stack,
where the last element is the top of the stack. Each element of the stack is a
2-element ARRAY reference, where the first element is a
L<FCM::Context::Locator|FCM::Context::Locator> object and the second element is
the line number. (At the top of the stack, the line number is set to 0.) The 2nd
optional argument of this event is a number to adjust the verbosity level of the
event.
=item FCM::Context::Event->CONFIG_VAR_UNDEF
This event is raised when a variable is undefined. The arguments of this event
contain 2 elements. The 1st element is the configuration entry as a blessed
reference of L<FCM::Context::ConfigEntry|FCM::Context::ConfigEntry>. The 2nd
element is the name of the variable.
=item FCM::Context::Event->E
This event is raised when to notify an exception. The 1st argument of this event
should be the exception.
=item FCM::Context::Event->EXPORT_ITEM_CREATE
This event is raised when the export-items system creates a link to an item.
The 1st argument is the namespace of the item, the 2nd argument is the revision
of the item and the 3rd argument is the name of the link.
=item FCM::Context::Event->EXPORT_ITEM_DELETE
This event is raised when the export-items system deletes a link to an item.
The 1st argument is the namespace of the item, the 2nd argument is the revision
of the item and the 3rd argument is the name of the link.
=item FCM::Context::Event->FCM_VERSION
This event is raised to notify the FCM version.
=item FCM::Context::Event->KEYWORD_ENTRY
This event is raised to notify a keyword entry. The 1st argument is the keyword
entry as a blessed reference of FCM::Context::Keyword::Entry as described in
L<FCM::Context::Keyword|FCM::Context::Keyword>.
=item FCM::Context::Event->MAKE_BUILD_SHELL_OUT
This event is raised to notify (shell command) output from make/build. The 1st
argument should be the STDOUT, and the 2nd argument should be the STDERR.
=item FCM::Context::Event->MAKE_BUILD_SOURCE_ANALYSE
This event is raised when the make/build system has analysed a source file. The
1st argument should be a blessed reference of FCM::Context::Make::Build::Source
as described in L<FCM::Context::Make::Build|FCM::Context::Make::Build>. The 2nd
argument should be the time it takes for the analysis.
=item FCM::Context::Event->MAKE_BUILD_SOURCE_SUMMARY
This event is raised when the make/build system has analysed all its source
files. The 1st argument should be the total number of files. The 2nd argument
should be the number analysed. The 3rd argument should be the elapsed time. The
4th argument should be the total time, which may differ from the elapsed time if
the analysis is run on more than 1 process.
=item FCM::Context::Event->MAKE_BUILD_TARGET_DONE
This event is raised when the make/build system has successfully updated a
target or an update is unnecessary. The 1st argument is the target (as an
instance of FCM::Context::Make::Build::Target), the 2nd argument is the elapsed
time of the update, if relevant.
=item FCM::Context::Event->MAKE_BUILD_TARGET_FAIL
This event is raised when the make/build system failed to update a target or the
target is failed by its dependencies. The 1st argument is the target (as an
instance of FCM::Context::Make::Build::Target), the 2nd argument is the elapsed
time, if the target is failed by its update.
=item FCM::Context::Event->MAKE_BUILD_TARGET_FROM_NS
This event is raised when the make/build system has generated a build target
from a source or a source name-space. The arguments are: source/target
namespace, target task, target category, and the target key.
=item FCM::Context::Event->MAKE_BUILD_TARGET_MISSING_DEP
This event is raised when the make/build system has discarded a missing
dependency from a target. The 1st argument is the target ID, the 2nd argument is
the dependency ID, and the 3rd argument is the dependency type.
=item FCM::Context::Event->MAKE_BUILD_TARGET_SELECT
This event is raised when the make/build system has selected a set of targets to
build. The 1st argument is a HASH reference of the target set.
=item FCM::Context::Event->MAKE_BUILD_TARGET_SELECT_TIMER
This event is raised when the make/build system has completed the target select
and dependency tree analysis. The only argument is the elapsed time.
=item FCM::Context::Event->MAKE_BUILD_TARGET_STACK
This event is raised when make/build system checks a target for cyclic
dependency. The 1st argument is the key of the task. The 2nd argument is rank
of the task in the dependency hierarchy. The 3rd argument is the number of
dependencies the task has if the task has already been checked, or undef if this
is the first check for the task.
=item FCM::Context::Event->MAKE_BUILD_TARGET_SUMMARY
This event is raised when the make/build system has finished updating its
targets, and is ready to give a total summary. The 1st argument is the number of
modified targets, the 2nd argument is the number unchanged, the 3rd argument is
the number failed, the 4th argument is the elapsed time.
=item FCM::Context::Event->MAKE_BUILD_TARGET_TASK_SUMMARY
This event is raised when the make/build system has finished updating its
targets, and is ready to give a summary of each type of task. The 1st argument
is the task type name, the 2nd argument is the number of modified targets, the
3rd argument is the number unchanged, the 4th argument is the number failed, and
the 5th argument is the total time spent on this task type.
=item FCM::Context::Event->MAKE_BUILD_TARGETS_FAIL
This event is raised when the make/build system has finished updating its
targets, but some targets failed to update. The 1st argument is an ARRAY of
FCM::Context::Make::Build::Target objects representing the failed targets.
=item FCM::Context::Event->MAKE_DEST
This event is raised when the make system sets up the destination. The 1st
argument of this event is the make system context.
=item FCM::Context::Event->MAKE_EXTRACT_PROJECT_TREE
This event is raised after the make/extract system has finished gathering
information for the source trees of each project. The 1st argument is a HASH of
the (keys) project name-spaces and the (values) list (ARRAY) of source tree
locators L<FCM::Context::Locator|FCM::Context::Locator> in the project.
=item FCM::Context::Event->MAKE_EXTRACT_RUNNER_SUMMARY
This event is raised after the make/extract system has finished using the task
runner to perform some tasks. The 1st argument is an identifier for the tasks
performed. The 2nd argument is the number of tasks. The 2nd argument is the
elapsed time. The 3rd argument is the total time in all processes.
=item FCM::Context::Event->MAKE_EXTRACT_SYMLINK
This event is raised as the make/extract system ignores a source that is a
symbolic link. The 1st argument of this event should be a blessed reference of
FCM::Context::Make::Extract::Source as described in
L<FCM::Context::Make::Extract|FCM::Context::Make::Extract>.
=item FCM::Context::Event->MAKE_EXTRACT_TARGET
This event is raised as the make/extract system updates a target destination. The
1st argument of this event should be a blessed reference of
FCM::Context::Make::Extract::Target as described in
L<FCM::Context::Make::Extract|FCM::Context::Make::Extract>.
=item FCM::Context::Event->MAKE_EXTRACT_TARGET_SUMMARY
This event is raised after the make/extract system has updated all target
destinations. The 1st argument of this event is a HASH reference, which contains
2 keys: status and status_of_source, i.e. the destination status of the targets
and the source status of the targets respectively. The values of both are HASH
references. The keys are the names of the status, and the values are the number
of targets with the corresponding status.
=item FCM::Context::Event->MAKE_MIRROR
This event is raised as the make/mirror system updates a target destination. The
1st argument of this event should be the target URI. The remaining arguments
should be the source paths.
=item FCM::Context::Event->OUT
This event is raised to notify (shell command) output. The 1st argument should
be the STDOUT, and the 2nd argument should be the STDERR.
=item FCM::Context::Event->SHELL
This event is raised to notify the completion of a shell command. The 1st
argument is an ARRAY reference of the shell command. The 2nd argument is an
integer to override the verbosity level. The 3rd argument is the return code and
the 4th argument is the elapsed time.
=item FCM::Context::Event->TASK_WORKERS
This event is raised on initialisation and destruction of worker processes for
the utility task runner. The 1st argument should either be "init" or "destroy".
The 2nd argument should be the number of workers initialised/destroyed.
=item FCM::Context::Event->TIMER
This event is raised at the start and end of the utility timer. The 1st
argument is the name of the piece of code to time. The 2nd argument is the start
the timer. The 3rd argument is the elapsed time at the end. If the 3rd argument
is not specified, it is the start of the timer.
=back
=head1 COPYRIGHT
(C) Crown copyright Met Office. All rights reserved.
=cut
|