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

Line corruption on line with escape characters #263

Closed
lgbaldoni opened this issue Oct 29, 2019 · 5 comments
Closed

Line corruption on line with escape characters #263

lgbaldoni opened this issue Oct 29, 2019 · 5 comments
Assignees
Labels

Comments

@lgbaldoni
Copy link

lgbaldoni commented Oct 29, 2019

Using spec-cleaner 1.1.5 on Tumbleweed. Giving an old .spec a once over:

sed -i "s|^M||g" README* bwbasic.doc COPYING

gave me this in return:

sed -i "s|
||g" README* bwbasic.doc COPYING

Please let me know if you need the entire file to reproduce this.

@scarabeusiv
Copy link
Contributor

Interestingly when I run it localy with file just containing this line in %install phase it does not break it.
Could you please add here the full spec so we can try to minimalize it?

@lgbaldoni
Copy link
Author

Here it is bwbasic.spec.gz

@scarabeusiv
Copy link
Contributor

Even with your full file I am unable to reproduce the issue, it does not replace the ^M with newline...

@scarabeusiv scarabeusiv changed the title Line corruption on 1.1.5 Line corruption on line with escape characters Oct 30, 2019
@scarabeusiv
Copy link
Contributor

Actually I can reproduce it, just the diff was not helpful as it seem to replace ^M for the actual action... Meh.

@kstreitova
Copy link
Contributor

Unfortunately, I'm afraid that there is nothing we can do about it. By default, Python translates ^M control character to '\n' (or to '\r' if you set newline option for open() function to ' '). And as different operating systems use different EOL sequences, we just can't simply differentiate if it's a part of the sed command or if it's a proper EOL for e.g. Mac OS.

In this case, I would suggest using dos2unix command instead of sed as a workaround.

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

No branches or pull requests

3 participants