[Scons-users] untar builder fails with error

daggs daggs at gmx.com
Mon Nov 7 05:53:41 EST 2022


Greetings Mats,

> Sent: Sunday, November 06, 2022 at 11:20 PM
> From: "Mats Wichmann" <mats at wichmann.us>
> To: scons-users at scons.org
> Subject: Re: [Scons-users] untar builder fails with error
>
> On 11/6/22 11:18, daggs wrote:
> > looks like this line change: new_targets = [ str(ent) for ent in tar_file.getmembers() if ent.isfile() ] works
> > Dagg.
> 
> The sequence in the emitter in the Wiki page looked like this:
> 
>      tarContents = sourceTar.getmembers()
>      tarFileContents = filter(lambda tarEntry: tarEntry.isfile(), 
> tarContents)
>      newTargets = map(tarInfoToNode, tarFileContents)
> 
> where:
> 
> def tarInfoToNode(tarInfoObject):
>      return File(tarInfoObject.name)
> 
> Then your original version had this:
> 
>      new_targets = [ ent for ent in tar_file.getmembers() if ent.isfile() ]
> 
> that's pretty notably (now I actually look at it) missing the call to 
> tarinfoToNode.
> 
> your new version is forcing to to string.
> 
>     new_targets = [ str(ent) for ent in tar_file.getmembers() if 
> ent.isfile()
> 
> this improves things because before you were getting a list of tarInfo 
> objects from getmembers(), effectively filtering out non-file entries - 
> but such objects presumably aren't directly useful to SCons; now you're 
> getting the string version, which is presumably the same as the .name 
> attribute.  Any reason not to go ahead and convert those to File nodes 
> at the same time?

if I'm not mistaken, the File obj wasn't found

Dagg


More information about the Scons-users mailing list