A nice thing would be to update the .make file directly without manual copy/pasting.

How I see that:

  • Either use the function make_generate_print() with the file argument to replace, but we will lose all information in commetns
  • Use regexes to update the original content: for each project, find its correspond line(s) and replace with the generated one

Comments

basvanderheijden’s picture

That would indeed be nice, and I thought about it while making this module.
However, it will be diffcult, because the original .make file can have many different formats, i.e.:

projects[backup_migrate][version] = "7.x-3.0"

projects[backup_migrate][version] = "3.0"

projects[backup_migrate] = "3.0"

projects[backup_migrate][version] = 3.0
basvanderheijden’s picture

The regular expression fix would be the best.. but I don't know how to do this.
Any idea, SebCorbin?

daften’s picture

You always have to use the version identifier. Also with the new yaml format at least, not using quotes around the version number with version that ends in .0 will just use the lates from that branch, because e.g. 3.0 is parsed as just 3.
I'd say use regex and always replace the version line, with a string like '3.0'.

basvanderheijden’s picture

Having given this issue more thought: I think replacing the original file with regexes is much more error prone than parsing the make file and spitting out a new format.
This way, you could also have an .ini file as input, while outputting a (new) yaml .yml file.