[tlbuild] How to install a Perl script

Karl Berry karl at freefriends.org
Fri Jun 16 00:42:39 CEST 2023


Hi Andreas,

    I would like to add the Perl script 'proofsort' 

Basically a matter of adding to bin_PROGRAMS in cweb.am and running
automake. But if/since we're adding a new executable to the bindir, some
infrastructure stuff is needed.

First, everything would be simpler if you renamed the script to
ctwill-refsort in the repo so we don't have two different names.  I know
that doesn't follow the existing refsort, twinx, pattern. I'd argue it
would be cleaner to rename those too. Must we have these different names?

Other stuff:

The script should start with #!/usr/bin/env perl, not #!/usr/bin/perl.

The script should accept --help and --version options, and do something
reasonable with them.

There should be a man page. Probably just add it to the NAME list in
ctwill.man and write a few words about it in the text there.

It would be nice if there was a test, though not absolutely
necessary. Even if the "test" just invokes --help or --version,
experience has shown that is worthwhile. There should be a test for
ctwill-refsort et al. too. Maybe one test script like ctwill-util.test
to invoke all of these small utilities would suffice.

As a matter of coding style (certainly not required), but I find code
to be much more readable with spaces around assignment operators. Like	
  $print_index = 1;
instead of
  $print_index=1;
Even more so with Perl's =~ (not-really-assignment :) operator.

Happy hacking,
Karl




More information about the tlbuild mailing list.