Subject: | DISTVNAME is a time bomb |
Imagine a module that defines its version as
our $VERSION = "1.00 /";
If - what is normal - VERSION_FROM is set to that module file, look
at what is created in the generated Makefile:
DISTVNAME = Foo-Bar-1.00 /
(no quotation either)
The makefile furter has a cleanup:
$(RM_RF) $(DISTVNAME)
Hmmm, no quotation either. Not much imagination needed to see what will happen
In a less intrusive example
our $VERSION = "1.00 - 2020-06-25";
The generated Makefile will cause warnings, like
Makefile:660: warning: overriding recipe for target 'Foo-Bar-1.00'
Makefile:648: warning: ignoring old recipe for target 'Foo-Bar-1.00'
Makefile:660: warning: overriding recipe for target '-'
Makefile:648: warning: ignoring old recipe for target '-'
Several options:
• The VERSION should be trimmed to something safe
• Die if $VERSION has whitespace
• Die if $VERSION has any special character
• Create correct quotation