Re: untar builder fails with error
daggs <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <trinity-7ed6dfd9-206a-4ffb-be05-ff8647e75459-1667818421815@3c-app-mailcom-bs08> |
Greetings Mats, > Sent: Sunday, November 06, 2022 at 11:20 PM > From: "Mats Wichmann" <[email protected]> > To: [email protected] > 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