Skip to content
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

dist on Windows creates a zip file with zip entries paths that include \ making the zip unusable on Linux #1907

Closed
lucdew opened this issue Oct 24, 2013 · 4 comments

Comments

@lucdew
Copy link

lucdew commented Oct 24, 2013

Hi,
when using the dist target on Windows with play 2.2.0, the generated zip file has paths that include . Consequently, the zip file cannot be used on Linux, because when the paths that include a backslash are converted to files. For instance here's an extract of the output of unzip -t
play-app/conf/\application.conf play-app/share/doc/api/\index.html

I think the issue comes from the line 236 of PlaySettings.scala (2.2.0 tag):
confFile -> ("conf/" + confFile.getCanonicalPath.substring(confDirectoryLen))
The confDirectoryLen does not include the path separator and the substring keeps a heading backslash.

Maybe you should do the following
confFile -> ("conf/" + confFile.getCanonicalPath.replace("\\","/"))

Same for doc api :

docFile -> ("share/doc/api/" + docFile.getCanonicalPath.substring(docDirectoryLen).replace("\\","/"))

@doswell
Copy link

doswell commented Oct 28, 2013

I've noticed this same issue, on a windows extract, using windows explorer it'll ask fora password when it attempts these directories (skipping it does extract all files still).
7-zip shows it as a blank directory name.
Does that just need a +1 so the substring works correctly. ie if confDirectoryLen is 4 for 'conf', and for an entry 'conf\logger.xml' that'll cause the substring to return '\logger.xml', concatenated with confFile would result in; 'conf/\logger.xml'.

@lucdew for other directories under conf/api, are they extracted ok on Linux?

@doswell
Copy link

doswell commented Oct 28, 2013

Nevermind found the answer, tried changing the conf/ to conf and got (when extracted on linux)
-rwxr-xr-x 1 doswell is-staff 34620 2013-10-27 07:54 api\index.html
Removing the trailing / and using the replace seems to work. Not sure if that affects the build on a linux system.

@doswell
Copy link

doswell commented Oct 28, 2013

I've put in pull request #1937 as I ran into the same issue. This fixed it on a windows system and unzipping on Linux.

@benmccann
Copy link
Contributor

Closing this given sbt/sbt-native-packager#56. Please let us know if that is not sufficient for solving the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants