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

Split mode doesn't work on Windows #141

Closed
eevan78 opened this issue Jul 24, 2018 · 7 comments
Closed

Split mode doesn't work on Windows #141

eevan78 opened this issue Jul 24, 2018 · 7 comments

Comments

@eevan78
Copy link
Contributor

eevan78 commented Jul 24, 2018

Hi,
I was trying to run po4a with Strawberry Perl 5.28.0.1 on Windows 7 x64.
I have set up the PERLLIB variable and call the po4a like this:

C:\Users\7\Downloads\po4a-master>perl po4a \doc\po4a.cfg
Split mode, creating a temporary POT

(289 entries)
Can't move \tmp\po4aaWPS.pot to /doc/original/POT/usr_01.txt.pot: No such file or directory.

Temporary POT is created in C:\tmp but it's name is po4aO__T.pot.
I have attached my configuration file.

po4a-cfg.zip

@mquinson
Copy link
Owner

Hello,

I've just activated the appveyor CI solution to investiguate windows issues. Say tuned ;)

@mquinson
Copy link
Owner

mquinson commented Aug 2, 2018

It does not seem to be directly linked to windows, as all our tests pass on Windows too. I think we need another test for the split mode.

@eevan78
Copy link
Contributor Author

eevan78 commented Apr 12, 2019

I have tested this issue thoroughly and found out what's wrong.
It is msggrep that doesn't output anything, because source file parameter of -N is enclosed in quotes. So output temp file is not created. Here is where the script ends (using --debug):

po4a::transtractor::process: Chdir . (calldir)
 (4951 entries)
msggrep.exe -N 'c:/Data/Projects/doc-prevod/original/TXT/usr_22.txt' -o C:\temp\po4adulK.pot C:\temp\po4aOECy.pot
diff: C:\temp\po4adulK.pot: No such file or directory
Can't unlink C:\temp\po4adulK.pot: No such file or directory.

So I have removed the quotes from the line 1345 of po4a:
my $cmd = "msggrep".$Config{_exe}." -N '$master' -o ".

to become:
my $cmd = "msggrep".$Config{_exe}." -N $master -o ".

After that everything works fine.

It is interesting to note that on Linux the original code with quotes around $master work OK. I haven't tried yet to remove them and see if it will break.

@eevan78
Copy link
Contributor Author

eevan78 commented Apr 12, 2019

I forgot to mention, the line number is from the version 0.55.
In the current one (0.55-alpha) it is the line 1292.

@mquinson
Copy link
Owner

Does it work if you use some double quotes intead of single quotes?

my $cmd = "msggrep".$Config{_exe}." -N \"$master\" -o ".

These quotes are mandatory in the case where there is a space in the name of the master file. If it does not work with double quote for you, we'll gonna start the external process another way.

@eevan78
Copy link
Contributor Author

eevan78 commented Apr 13, 2019

Yes, it also works with escaped double quotes.
Here's the excerpt of debug output:

.
.
.
po4a::transtractor::process: Call read(c:/Data/Projects/doc-prevod/original/TXT/usr_03.txt)
po4a::transtractor::process: Done read(c:/Data/Projects/doc-prevod/original/TXT/usr_03.txt)
po4a::transtractor::process: Call parse()
po4a::transtractor::process: Done parse()
po4a::transtractor::process: Chdir . (calldir)
 (453 entries)
msggrep.exe -N "c:/Data/Projects/doc-prevod/original/TXT/usr_01.txt" -o C:\temp\po4a5Fin.pot C:\temp\po4aIMOF.pot
msggrep.exe -N "c:/Data/Projects/doc-prevod/original/TXT/usr_toc.txt" -o C:\temp\po4aLIeT.pot C:\temp\po4aIMOF.pot
msggrep.exe -N "c:/Data/Projects/doc-prevod/original/TXT/help.txt" -o C:\temp\po4aRxEC.pot C:\temp\po4aIMOF.pot
msggrep.exe -N "c:/Data/Projects/doc-prevod/original/TXT/usr_02.txt" -o C:\temp\po4aTJD_.pot C:\temp\po4aIMOF.pot
msggrep.exe -N "c:/Data/Projects/doc-prevod/original/TXT/usr_03.txt" -o C:\temp\po4a3BP9.pot C:\temp\po4aIMOF.pot
.
.
.

Everything finishes nice.

@mquinson
Copy link
Owner

Thanks a lot, I just commited what I believe to be a fix.

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

No branches or pull requests

2 participants