Closed quinnj closed 9 years ago
I think you need to rebase this off of origin/master
.
Yeah, I got the commits a little mixed up. Should be fixed now.
Ok, think I finally got it figured out.
When I run this locally, I get:
julia> Pkg.test("GZip")
INFO: Testing GZip
ERROR: LoadError: test failed: (1775 == 5765)
in expression: position(gzfile,true) == pos
in error at error.jl:21
in default_handler at test.jl:29
in do_test at test.jl:52
in include at ./boot.jl:252
in include_from_node1 at loading.jl:134
in process_options at ./client.jl:310
in _start at ./client.jl:409
while loading /Users/kevin/.julia/v0.4/GZip/test/runtests.jl, in expression starting on line 96
As far as I can tell, it was version 1.2.3 where they re-orged a lot of the repository and introduced gzoffset
; that was back in 2011.
(Ignore the 5765
's--I had added some debug print statments. Removed inline on github.)
Maybe there's no gzoffset64
then? At least in the version on github?
Ok, fixed the test, renamed the arg to raw
and added GZLIB_VERSION
and made calling gzoffset
conditional on having a recent enough version of the library. Hopefully that will do it?
Weird, not sure why it's not finding gzoffset64
. I'm seeing that defined all the way back to when gzoffset
was first introduced.
Good to merge?
Would you be willing to change all of the versions from strings to Versions? I don't think the Version type existed when this was originally written, and Versions would make more sense when testing, well, versions.
The problem is that VersionNumber
doesn't support 1.2.3.9
, only 1.2.3
. I figured it was better to be more accurate vs. truncate the version number.
Ah, right, forgot about that limitation. I proposed once to extend Version (for BinDeps/Debian versioning), and that wasn't accepted, but it would be great to have extended version functionality in a package so we could use it for these things.
Yeah, seems like that would be good to have. Thanks for merging. I'll tag a version in METADATA.
This PR changes
position
toposition(::GZip.Stream,of_raw::Bool=false)
, withposition(f,true)
returning the value ofgzoffset
.My use case is splitting gzipped files into smaller chunks by entire lines, so I open a gzip file, read a line, then write it out to a new GZip.Stream. In the mean time, I need to track how many compressed bytes my new gzip file is to know when to close it.