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

Escaping characters kept during the whole toolchain #121

Open
Niols opened this issue Feb 21, 2020 · 8 comments
Open

Escaping characters kept during the whole toolchain #121

Niols opened this issue Feb 21, 2020 · 8 comments
Assignees

Comments

@Niols
Copy link
Member

Niols commented Feb 21, 2020

Take package libkf5xmlrpcclient5. Here is its preinst:

dpkg-maintscript-helper rm_conffile /etc/xdg/kxmlrpcclient.categories 5.61.0-1\~\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/xdg/kxmlrpcclient.renamecategories -- "$@"

Now run colis-language on this script. You get the following in the logs:

 [ERR] wrong version 5.61.0-1\~\~

This is the symbolic version of the utility dpkg-maintscript-helper complaining that 5.61.0-1\~\~ is not a valid version number. And this is correct, as the version number that would actually reach dpkg-maintscript-helper in the original script is 5.61.0-1~~ which is a valid version number.

Now this comes from the fact that Morbig, in its parser of words, keeps the backslashes. It has already been mentionned in colis-anr/morbig#110, but this issue has not gotten any answer yet, so I don't know whether it is a bug that should be fixed or a feature. In the first case, the bug should be fixed in Morbig. In the second case, the conversion to Colis needs to take that into account.

@yurug Which is it?

@Niols
Copy link
Member Author

Niols commented Feb 21, 2020

That being said, in package ipset, whose preinst is:

dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/ipset 6.25.1-1~ -- "$@"

we get:

[ERR] wrong version 6.25.1-1~

which should be a valid version, in which case our version parser in our symbolic utility dpkg-maintscript-helper would be broken too? @treinen What do you think?

@treinen
Copy link
Contributor

treinen commented Feb 21, 2020 via email

@Niols
Copy link
Member Author

Niols commented Feb 21, 2020

How stupid can I be. There was indeed no dpkg on the machine. Forget that second point… What surprises me a bit more is that 5.61.0-1\~\~ seems to be accepted? I'll investigate a bit more in an environment with dpkg…

@treinen
Copy link
Contributor

treinen commented Feb 21, 2020 via email

@treinen
Copy link
Contributor

treinen commented Feb 21, 2020 via email

@Niols
Copy link
Member Author

Niols commented Feb 21, 2020

a machine without dpkg, how is that possible?

My arch linux laptop.

maybe availability of dpkg could be checked at startup of the tool.

Or at least dynamically when handling the return value of the call to dpkg (if the return code is 127 for instance).

@Niols
Copy link
Member Author

Niols commented Feb 21, 2020

The "" character is not allowed in debian version strings. Aren't these "" simply interpreted by the shell ?

On the given example, they are here to protect the special character ~ (although it is not so special at that place, so I don't know), and they disappear during the expansion phase of the Shell. But we don't have an expansion phase per se, so we can either consider that it should be removed in the parsing of CST words (and in Morbig) or in the expansion (emulated by the conversion, or in the evaluation semantics of Colis).

@treinen
Copy link
Contributor

treinen commented Feb 21, 2020 via email

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

No branches or pull requests

3 participants