Re: FYI: On the way to -w
Akim Demaille wrote: > Tom Tromey <[EMAIL PROTECTED]> writes: > > > What remains in order to enable `use strict'? [. . .] > > $require_file_found{'depcomp'} = 1 if -f "$depcomp_dir/depcomp"; > > it is because of this guy. It should not be used directly here, but > to fix this properly, I have to understand how to use the regular > mechanisms (i.e., study what you said about the special case of > depcomp not being like missing and the like). > > We could use use strict right now *if* we declare %require_file_found > is global. But I didn't because it's a lie, it's not where we are > going to. I sent a patch a while ago, ostensibly to fix the depcomp support, but which cleans up a bunch of the require_file stuff, including removing this line. And oh, was it a mess before I went at it. You should have the rest of the asssignments necessary to use it shortly. I mailed them Monday evening. I can even resubmit a new version which resolves the current conflicts, I believe, as long as I do it on my own time. I'm not sure how long it'll be before I can do automake work on my day job again. :) Derek -- Derek Price CVS Solutions Architect ( http://CVSHome.org ) mailto:[EMAIL PROTECTED] CollabNet ( http://collab.net ) -- On every question of construction [of the Constitution], let us carry ourselves back to the time when the Constitution was adopted, recollect the spirit manifested in the debates, and instead of trying what meaning may be squeezed out of the text, or invented against it, conform to the probable one in which it was passed. - Thomas Jefferson, letter to William Johnson, June 12, 1823, _The Complete Jefferson_, p. 322.
Re: FYI: On the way to -w
> "Akim" == Akim Demaille <[EMAIL PROTECTED]> writes: Akim> Tom, I'd like to know what you'd prefer: fixing the uses of $2 Akim> etc., or the definition of the groups in the regexps? Whichever is clearest in the given situation. Tom
Re: FYI: On the way to -w
Tom Tromey <[EMAIL PROTECTED]> writes: > Akim> I preferred to have transform _required_ a defined value for > Akim> each key, to make sure there are no accidents. So I fixed the > Akim> sites where %transform receives an uninitialized value. > > Sounds great. > > What remains in order to enable `use strict'? # Handle auto-dependency code. sub handle_dependencies { if ($use_dependencies) { # Include auto-dep code. Don't include it if DEP_FILES would # be empty. if (&saw_sources_p (0) && keys %dep_files) { my $config_aux_dir_specified = ($config_aux_dir ne '.' && $config_aux_dir ne ''); # Set $require_file_found{'depcomp'} if the depcomp file exists, # before calling require_config_file on `depcomp'. This makes # require_file_internal skip its buggy existence test that would # make automake fail (with `required file `lib/depcomp' not found') # when AC_CONFIG_AUX_DIR is not set. See tests/subdir4.test. my $depcomp_dir = ($config_aux_dir_specified ? $config_aux_dir : '.'); > $require_file_found{'depcomp'} = 1 if -f "$depcomp_dir/depcomp"; it is because of this guy. It should not be used directly here, but to fix this properly, I have to understand how to use the regular mechanisms (i.e., study what you said about the special case of depcomp not being like missing and the like). We could use use strict right now *if* we declare %require_file_found is global. But I didn't because it's a lie, it's not where we are going to.
Re: FYI: On the way to -w
Akim> I preferred to have transform _required_ a defined value for Akim> each key, to make sure there are no accidents. So I fixed the Akim> sites where %transform receives an uninitialized value. Sounds great. What remains in order to enable `use strict'? Tom
Re: FYI: On the way to -w
Tom, I'd like to know what you'd prefer: fixing the uses of $2 etc., or the definition of the groups in the regexps? For instance, I have this: Index: automake.in === RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.970 diff -u -u -r1.970 automake.in --- automake.in 2001/03/05 19:29:16 1.970 +++ automake.in 2001/03/05 19:37:25 @@ -1,4 +1,4 @@ -#!@PERL@ +#!@PERL@ -w # -*- perl -*- # @configure_input@ @@ -6726,8 +6726,8 @@ # line). # I'm quite shoked! It seems that (\\\n|[^\n]) is not the # same as `([^\n]|\\\n)!!! Don't swap it, it breaks. - my ($relationship, $actions) = - /^((?:\\\n|[^\n])*)(?:\n(\t.*))?$/som; + /^((?:\\\n|[^\n])*)(?:\n(\t.*))?$/som; + my ($relationship, $actions) = ($1, $2 || ''); # Separate targets from dependencies: the first colon. $relationship =~ /^([^:]+\S+) *: *(.*)$/som; @@ -6843,8 +6843,9 @@ { if ($varname =~ /^(nobase_)?(dist_|nodist_)?(.*)_$primary$/) { - if (($2 ne '' && ! $can_dist) - || (! defined $valid{$3} && ! &variable_defined ($3 . 'dir'))) + my ($base, $dist, $X) = ($1 || '', $2 || '', $3 || ''); + if (($dist ne '' && ! $can_dist) + || (! defined $valid{$X} && ! &variable_defined ("${X}dir"))) { # Note that a configure variable is always legitimate. # It is natural to name such variables after the @@ -6857,7 +6858,7 @@ else { # Ensure all extended prefixes are actually used. - $valid{$1 . $2 . $3} = 1; + $valid{"$base$dist$X"} = 1; } } } Changing the regexp would make them much more complex.
FYI: On the way to -w
I preferred to have transform _required_ a defined value for each key, to make sure there are no accidents. So I fixed the sites where %transform receives an uninitialized value. There are many other places to fix, most typically $2 etc. which do not exist, such as in the example below. Index: ChangeLog from Akim Demaille <[EMAIL PROTECTED]> * automake.in (&handle_options): Change the RE so that the third part of the versions always exist. (&file_contents): Don't pass uninitialized values to &transform. 2001-03-05 Akim Demaille <[EMAIL PROTECTED]> Index: automake.in === RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.969 diff -u -u -r1.969 automake.in --- automake.in 2001/03/05 19:11:31 1.969 +++ automake.in 2001/03/05 19:28:41 @@ -1185,14 +1185,14 @@ { $use_dependencies = 0; } - elsif (/([0-9]+)\.([0-9]+)([a-z])?/) + elsif (/([0-9]+)\.([0-9]+)([a-z]?)/) { # Got a version number. my ($rmajor, $rminor, $ralpha) = ($1, $2, $3); &prog_error ("version is incorrect: $VERSION") - if $VERSION !~ /([0-9]+)\.([0-9]+)([a-z])?/; + if $VERSION !~ /([0-9]+)\.([0-9]+)([a-z]?)/; my ($tmajor, $tminor, $talpha) = ($1, $2, $3); @@ -6634,14 +6634,14 @@ 'MAINTAINER-MODE' => $seen_maint_mode ? '@MAINTAINER_MODE_TRUE@' : '', - 'SHAR'=> $options{'dist-shar'}, - 'BZIP2' => $options{'dist-bzip2'}, - 'ZIP' => $options{'dist-zip'}, - 'COMPRESS'=> $options{'dist-tarZ'}, + 'SHAR'=> $options{'dist-shar'} || 0, + 'BZIP2' => $options{'dist-bzip2'} || 0, + 'ZIP' => $options{'dist-zip'} || 0, + 'COMPRESS'=> $options{'dist-tarZ'} || 0, 'INSTALL-INFO' => !$options{'no-installinfo'}, 'INSTALL-MAN' => !$options{'no-installman'}, - 'CK-NEWS' => $options{'check-news'}, + 'CK-NEWS' => $options{'check-news'} || 0, 'SUBDIRS' => &variable_defined ('SUBDIRS'), 'CONFIGURE-AC' => $configure_ac,