14

This question led to a new package:
ctanupload

sty2dtx and ctanify are useful tools to prepare clean packages to CTAN. Is there also a tool to upload the package from a terminal?

raphink
  • 31,894
  • I made once a Makefile which called firefox with the complete form data except the file name as part of the URL, but it doesn't work any longer. Might be caused by changes in the CTAN upload form or maybe by the new Firefox version. However, it then didn't worked in my tests with other browser as well. – Martin Scharrer Sep 02 '11 at 08:34
  • @Martin: oh my! Wouldn't curl do the job? – raphink Sep 02 '11 at 08:35
  • It looks like it would. Also a Perl script using a WWW library would also be an option. It then could display the data first before sending it. I don't think the CTAN admins woudl be happy to get a lot of faulty uploads ;-) – Martin Scharrer Sep 02 '11 at 08:45
  • @Martin: indeed, we would need to check stuff before uploading. Ideally, I think the script would call ctanify to make sure to upload something clean, and parse the archive to get the author, package name, description, version, etc. It would then ask for confirmation before sending. – raphink Sep 02 '11 at 08:47
  • Parsing the archive would be cumbersome and error-prone. The script should be called with the correct data. The whole thing including ctanify can then be part of a Makefile. – Martin Scharrer Sep 02 '11 at 08:50
  • If the requirement is from the terminal rather than programmatic then would lynx or similar suit the purpose? – mas Sep 02 '11 at 11:04
  • @Martin Scharrer: Robin Fairbairns is pretty laid-back about upload issues. (Usually, using some form of automation means less rather than more issues: I do a lot of CTAN updates, and all of the building is done using scripts so I don't forget files/line endings/...) – Joseph Wright Sep 02 '11 at 11:04
  • @mas: the idea is to type a single command (or even put it in a Makefile) to upload packages, not to fill forms in lynx or links2. – raphink Sep 02 '11 at 12:00
  • related project: github action at https://github.com/paolobrasolin/ctan-submit-action – cmhughes Apr 10 '23 at 19:04

1 Answers1

16

Update 2011/09/07: Now on CTAN: ctanupload, including PDF manual.

I had now a look on how to code a script to handle the WWW form upload and went with Perl and the WWW::Mechanize library. The following script allows to upload a contribution to CTAN. The form fields can be provided using --<name>=<value> or using environment variables, which simplifies the use in Makefiles. I also implemented an interactive mode and error checking for the input. I uploaded the script itself to CTAN as ctanupload.

Usage:

See README file on CTAN.

Script:

Available on CTAN ctanupload.pl or over the source code repository: https://bitbucket.org/martin_scharrer/ctanupload

Martin Scharrer
  • 262,582