On Dec 16, 2014, at 1:24 PM, Dominique d'Humières <domi...@lps.ens.fr> wrote:
> My patch is different and I am attaching it (it is quite old, so it may not 
> apply cleanly). The problem for more evolved form is that *.dSYM are 
> directories and ASAICT there is no command in derange to remove them.
> 
> At least my patch tracks all the locations giving *.dSYM.

So, I think it would be better to do:

  remote_file build deletedir $dsym_file

And then replace standard_file (from remote.exp) with a patched routine that 
adds:

            deletedir {
                foreach x $args {
                    if { [file exists $x] && [file isdirectory $x] } {
                        exec rm -rf $x
                    }
                }
                return
            }

and:

            deletedir {
                foreach x $args {
                    if { [file exists $x] && [file isdirectory $x] } {
                        exec rm -rf $x
                    }
                }
                return
            }

and try that.  The patched routine can go into dejagnu144-fixes.exp then you 
just include this way up at the top from the same thing that include the thing 
that includes remote.exp.  That patch can be submitted to dejagnu, and when 
that comes out, we should just return from the 144-fixes.exp file when the 
version number is >= the fixed version.

If that’s too annoying, how about:

  remote_file_build_deletedir $dsym_file

and then define that to do the operation, protected by:

    if { [is_remote target] } { return }

That’s pretty good, and once we switch to a dejagnu that supports deleting a 
directory, we could then remove it and just use remote_file.

It is a shame that there are a zillion places where this idiom is repeated.  
What a nightmare.  I can’t help but wonder if we aren’t better off just doing:

  find $testingdir . -type d -name \*.dSYM -exec rm -rf

at the end of testing, and be done with it, forever, no squirrelly lines all 
over the place, and 0 chance it will ever need maintenance or that someone 
might add a new fragment that won’t cleanup on darwin.  Might even be faster.  
Not pretty, but dSYM didn’t start out pretty either.  Also, less of an eyesore 
in the general code.

Reply via email to