-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with .7 where 7zip extracts the file without the noarch%2F on it (Take2) #141
Conversation
src/WinRPM.jl
Outdated
@@ -463,7 +463,13 @@ function do_install(package::Package) | |||
write(f, data[1]) | |||
end | |||
info("Extracting: ", name) | |||
cpio = splitext(path2)[1]*".cpio" | |||
|
|||
@static if VERSION < v"0.7.0-DEV" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be specific to the merge commit that upgraded 7zip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. but my newness to Julia means I need some help here. Is there an easy way to find that other than digging through hundreds of commits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a commit-name script in contrib of a julia checkout, run it on JuliaLang/julia@8153470
src/WinRPM.jl
Outdated
@@ -464,7 +464,7 @@ function do_install(package::Package) | |||
end | |||
info("Extracting: ", name) | |||
|
|||
@static if VERSION < v"0.7.0-DEV" | |||
@static if VERSION < v"0.7.0-DEV.2181" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the @static
isn't really necessary
Looks okay if you've tested it. But as with #137, wouldn't basename be a cleaner way of accomplishing the |
Switched to basename(). I also verified code as of 98878bd still downloads and extracts files without errors on my .7 and .6 installs. |
This approach also handles filenames containing |
I don't handle the filenames any differently than the code that was in place does. The only change that has been made is that any directory parts of the filename are now chopped off I.E. if the file is named The old code was in essence (combining two lines into one): |
Thanks. If you've tested it and it works, looks good to me. @tkelman Fine with you too? |
Unlike #137, this looks like it should avoid breaking anything on 0.6 |
Meaning, OK to merge? :-) |
bump hdf5 build fails without this patch |
would also be good to tag after this |
@tkelman Bump? I'm afraid you're the only one which knows this package enough. :-) |
Should really set up appveyor here to be sure but this is likely safe in its current form. |
Agreed. I did test locally that this pr worked. BTW i did try to get appveyor, but didn't add a proper cleaning step. I could look into that again, but no guarantees on when. For reference #95 |
OK, merging since anyway this doesn't change the behavior on 0.6, and it can't be worse on 0.7. |
I still have the issue also mentioned by @amellnik
However the file in that archive is called
|
@nalimilan @tkelman Can you have a look at my comment above, this kinda stops my 0.7/1.0 transition ? |
Dunno. What changed? |
in the download from the filename gets escaped. Then the compressed file is unpacked and it looks for .cpio. however in the compressed file the filename has not been escaped. |
13.2 is very old and shouldn't be referenced any more... the escaping must've been added for a reason and presumably worked and was necessary before? |
My bad, I just grabbed a random SUSE version to make my case, CBC uses 42.2 actually. |
There was a change in 7z version and behavior between julia 0.6 and julia 0.7, but that happened before February/March when this PR was worked on. I'm under the assumption the author and other commenters on this PR had tested it on 0.7-DEV at that point. I'm asking what changed since February. |
I tested this with a .6 and .7 later than 2181, when the 7 zip version changed. The behavior described exactly matches what this PR fixes. Are you accidentally using a cached version of WinRPM prior to when this merge happened? |
I see what you are saying. The patch fixed all the other cases because the filenames did not have any special characters in them. However, your c++ filename gets mangled because it has html escape characters in it. I agree the solution should be to just remove the escape() however I fear without testing this might break something else as this code is very arcane. My .7 Julia install is a bit out of date but I will see if I can get a new PR in with your proposed changes. |
I am willing to do the PR. |
Sounds like a good approach that will ensure the file gets handled appropriately. I'll lave it to you to do the PR then. |
OK, I'll tackle that. Not that much experience on git, so it's a good opportunity to learn something. |
Made the PR #157 |
This should fix #134 as well as any issue where WinRPM was failing to find the extracted cpio file from an rpm file. See #134 for a full discussion of why this was happening in .7.
This along with #136 & #139 should restore WinRPM to working condition in .7. However, the package produces a large number of warnings and a deprecation errors so this might change as .7 matures.
I am not sure if my @static if VERSION < v"0.7.0-DEV" is the proper way to fence off .7 code from .6 code. If not please let me know. I have tested this on both .7 and .6 and with this code in place files download, extract, and install successfully.
After looking this fix might be a duplicate of #137 as the problem looks the same but I did not look in depth at it.