-
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
Regex match (now basename) #137
base: master
Are you sure you want to change the base?
Conversation
I had trouble with `escape` butchering a folderpath into a filename. I found that using a simple regex match to pick off the filename solved my problems. Don't know if other people might have had this issue as well. I'm on Windows 7 and Julia v0.7.
Can you please elaborate? |
Sorry, wasn't sure how to explain that. JuliaStrings/StringEncodings.jl#22 is the relevant issue. If you look at the line that errors, it says
and when I looked in the folder, I saw this
So you see that the It is unclear to me why some files were written with the |
I suspect this would not work on julia 0.6, and is a difference in behavior between the different versions of 7zip bundled in julia 0.6 vs nightly. |
src/WinRPM.jl
Outdated
@@ -458,7 +458,7 @@ function do_install(package::Package) | |||
error("failed to download $name $(data[2]) from $source/$path.") | |||
end | |||
cache = getcachedir(source) | |||
path2 = joinpath(cache,escape(path)) | |||
path2 = joinpath(cache, match(r"[^/]+$",path).match) |
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 found that using a simple regex match to pick off the filename solved my problems.
The match
should probably be replaced with basename
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.
Did not know about that function! That seems to do the trick just fine.
The `basename` function does what the previous regex match did, so use that instead.
I had trouble with
escape
butchering a folderpath into a filename. I found that using a simple regex match to pick off the filename solved my problems. Don't know if other people might have had this issue as well. I'm on Windows 7 and Julia v0.7.