Converting Module::Install prereqs to Dist::Zilla with elisp
After half a day of yak-shaving that started with having to port yet another Makefile.PL to the dist.ini format, I am now finally able to post this small snippet of elisp code to blogs.perl.org from within emacs (more on that later):
Hope someone finds this useful... oh, and, yeah: first post!
(defun sbw/prereqs-to-dist-zilla () (interactive) (save-excursion (while (re-search-forward (concat "^\\(build_\\)?requires *['\"]\\([^'\"]*\\)['\"]" " *\\(=>\\|,\\)? *['\"]?\\([0-9_.]*\\)?['\"]? *[;,]") nil t) (replace-match (let ((module (match-substitute-replacement "\\2")) (version (match-substitute-replacement "\\4"))) (concat module " = " (if (string= version "") "0" version))) t nil) )) )
Cheers,
Sebastian
Have you looked at Dist::Zooky on CPAN? I find it does a pretty good first pass.
No, I haven't stumbled upon it. Seems like a great tool.