Update Linearize tool to support Windows paths; fix variable scope; update README and example configuration #6372

pull veqtrus wants to merge 1 commits into bitcoin:master from veqtrus:linearize_win changing 2 files +10 −8
  1. veqtrus commented at 11:51 AM on July 3, 2015: contributor

    Windows uses backslashes () in paths. An option has been added to allow setting which type of slash to be used. By default the forward slash (/) is used. Also updated the example configuration with the respective option.

    I added 'self.' in front of a few variables since without it the script didn't work for me.

    Minor fixes for README.

  2. jgarzik commented at 11:56 AM on July 3, 2015: contributor

    seems reasonable

  3. laanwj commented at 12:26 PM on July 3, 2015: member

    Python has excellent path manipulation utilities. Instead of making the path character configurable, why not use Python's path.join?

  4. laanwj added the label Dev Scripts on Jul 3, 2015
  5. jonasschnelli commented at 2:30 PM on July 3, 2015: contributor

    slightly tested ACK (not on windows). Would recommend to squash to purge out the reverts and the non-path.join way.

  6. in contrib/linearize/linearize-data.py:None in 5c29b7bf6c outdated
     209 | @@ -209,14 +210,14 @@ def run(self):
     210 |  				return
     211 |  			inLenLE = inhdr[4:]
     212 |  			su = struct.unpack("<I", inLenLE)
     213 | -			inLen = su[0] - 80 # length without header
     214 | +			self.inLen = su[0] - 80 # length without header
    


    laanwj commented at 2:41 PM on July 3, 2015:

    I'm not sure making inLen an instance variable is the right solution to the problem. Only one function outside run(), writeBlock(), uses self.inLen, which is never defined, but the on-disk size can be easily computed in the function itself with:

    def writeBlock(self, inhdr, blk_hdr, rawblock):
        blockSizeOnDisk = len(inhdr) + len(blk_hdr) + len(rawblock)
        if not self.fileOutput and ((self.outsz + blockSizeOnDisk) > self.maxOutSz):
    
  7. laanwj commented at 12:49 PM on July 10, 2015: member

    ACK after squashing commits into one

  8. veqtrus closed this on Jul 10, 2015

  9. Update Linearize tool to support Windows paths e3c42973b2
  10. veqtrus reopened this on Jul 10, 2015

  11. laanwj merged this on Jul 17, 2015
  12. laanwj closed this on Jul 17, 2015

  13. laanwj referenced this in commit dcc495e011 on Jul 17, 2015
  14. veqtrus deleted the branch on Jul 26, 2015
  15. zkbot referenced this in commit df07f9ad23 on Feb 15, 2017
  16. zkbot referenced this in commit ec069ce96c on Mar 3, 2017
  17. zkbot referenced this in commit 702eefc71a on Mar 3, 2017
  18. zkbot referenced this in commit 99c4c6de0c on Mar 3, 2017
  19. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me