While working on #652566: Support multiple download files per release in release history XML I had an idea for improving the filename parsing logic to handle .tar.gz extensions. It's going to affect both that patch, and our existing views handler, so I figured it was better to just open a new issue for it.
Basically, we explode the filename on '.', and pop stuff off the end. Currently, if the last extension is 'gz' or 'bz2', we pop again and append that, assuming it's because the filename looks like "foo.tar.gz". However, this is broken in a few ways:
- What if you just have "foo.gz"?
- What if you have ".tar.bz3"? ;)
Instead, we should just pop again. If what we find is 'tar', we use both. Otherwise, we just use the last thing we popped.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1006246-1.better-filename-parsing-for-tar.patch | 1.32 KB | dww |
Comments
Comment #1
dwwLike so.
Comment #2
dwwCommitted to HEAD.