From 4dfba4eb501bbbf65b55da7d171dfd5ef152b1f7 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Thu, 10 May 2012 12:55:04 +0200 Subject: [PATCH] [ng] cleanup: &Automake::Variable::hook is unused, remove it * lib/Automake/Variable.pm (hook): Delete, it's not used anymore. (%_hooks): Likewise. (define): Don't process variable hooks anymore. Signed-off-by: Stefano Lattarini --- lib/Automake/Variable.pm | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index ab9baad08..817167216 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -286,25 +286,6 @@ sub reject_var ($$) =over 4 -=item C - -Declare a function to be called whenever a variable -named C<$varname> is defined or redefined. - -C<$fun> should take two arguments: C<$type> and C<$value>. -When type is C<''> or <':'>, C<$value> is the value being -assigned to C<$varname>. When C<$type> is C<'+'>, C<$value> -is the value being appended to C<$varname>. - -=cut - -use vars '%_hooks'; -sub hook ($$) -{ - my ($var, $fun) = @_; - $_hooks{$var} = $fun; -} - =item C Returns the list of all L instances. (I.e., all @@ -786,9 +767,6 @@ by by L). C<$pretty> applies only to real assignments. I.e., it does not apply to a C<+=> assignment (except when part of it is being done as a conditional C<=> assignment). -This function will all run any hook registered with the C -function. - =cut sub define ($$$$$$$$) @@ -985,11 +963,6 @@ sub define ($$$$$$$$) $self->set ($cond, $def); push @_var_order, $var; } - - # Call any defined hook. This helps to update some internal state - # *while* parsing the file. For instance the handling of SUFFIXES - # requires this (see var_SUFFIXES_trigger). - &{$_hooks{$var}}($type, $value) if exists $_hooks{$var}; } =item C -- 2.47.2