Log Message: pkgtools/url2pkg: refactor generation of Makefiles By generating the content of the files before actually writing it to disk, the code becomes easier to test.