Re: help with deleting or cleaning files

Damien Hocking <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
Bill,

This is hugely useful, thank you. I'll volunteer to turn this into an 
example doc for SCons. Is there a template for those somewhere?

Damien

On 2020-09-27 4:55 p.m., Bill Deegan wrote:
> Clean() doesn't return a Node.
>
> From Manpage:
>
> This specifies a list of files or directories which should be removed 
> whenever the targets are specified with the|-c|command line option. 
> The specified targets may be a list or an individual target. Multiple 
> calls to*|Clean|*are legal, and create new targets or add files and 
> directories to the clean list for the specified targets.
>
> So debugclean and debuginstall1 will both be None.
>
> Clean just marks the file to be removed when you run `scons -c`
>
>
> This should do what you're looking for (minus dummy file creation...
> See gist:
> https://gist.github.com/bdbaddog/949eaa3c566cdb5a4d8c0fcb5e96b5e5
>
>
>
> On Sun, Sep 27, 2020 at 12:44 PM Mats Wichmann <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     On 9/27/20 12:15 PM, Damien wrote:
>     > All,
>     >
>     > As part of our installers, we put a set of dlls (or so's) into a
>     > directory, to go into one of our products. Because of the way this
>     > product is shipped, the dlls go into a directory that's not debug or
>     > release, it just has the binaries. When we're doing debug builds and
>     > testing, the debug dlls go into that directory and when we're doing
>     > release testing, the release versions go in there. I'd like to
>     automate
>     > removing the debug dlls if we do a release build and vice versa,
>     right
>     > now we do that by hand, which is silly.
>     >
>     > I thought we could do this with env.Clean(...) but that appears
>     not to
>     > be the case. Here's a cut down example in an SConscript:
>     >
>     > dbgfilelist  [
>     >          'concrt140d.dll',
>     >          'msvcp140d.dll',
>     >          'vccorlib140d.dll',
>     >          'vcomp140.dll',
>     >          'vcruntime140d.dll'
>     >       ]
>     >
>     > relfilelist = [
>     >          'concrt140.dll',
>     >          'msvcp140.dll',
>     >          'vccorlib140.dll',
>     >          'vcomp140.dll',
>     >          'vcruntime140.dll'
>     >       ]
>     >
>     > if thisenv['BUILDTYPE'] == 'DEBUG':
>     >       thisenv['INSTALLDIR'] = thisenv['BINDIR'] +
>     > '/../../interfaces/binaries/x64'
>     >       releaseclean = thisenv.Clean(thisenv['INSTALLDIR'], [x for
>     x in
>     > relfilelist])
>     >       releaseinstall1 = thisenv.Install(thisenv['INSTALLDIR'],
>     > [os.path.join(thisenv['BINDIR'], x) for x in dbgfilelist])
>     >       Default(releaseclean + releaseinstall1)
>     > else:
>     >       thisenv['INSTALLDIR'] = thisenv['BINDIR'] +
>     > '/../../interfaces/binaries/x64'
>     >       debugclean = thisenv.Clean(thisenv['INSTALLDIR'], [x for x in
>     > dbgfilelist])
>     >       debuginstall1 = thisenv.Install(thisenv['INSTALLDIR'],
>     > [os.path.join(thisenv['BINDIR'], x) for x in relfilelist])
>     >       Default(debugclean + debuginstall1)
>     >
>     > When I try this, SCons says: TypeError: unsupported operand
>     type(s) for
>     > +: 'NoneType' and 'list': for the Default setup. I always
>     thought you
>     > could just add Actions but obviously I'm doing something wrong.
>
>     I'd take the message seriously: something is None when you're not
>     expecting it.   Tracing that down (some print statements, maybe)
>     should
>     help you figure out if you're accessing things that aren't defined for
>     the buildtype you're doing and that's why they're None, or whether
>     some
>     step got missed somewhere.
>     _______________________________________________
>     Scons-users mailing list
>     [email protected] <mailto:[email protected]>
>     https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.