+sub help_and_exit {
+ my $msg = shift;
+ if ($msg) {
+ print "$msg\n\n";
+ }
+ print <<EOH;
+This builds Koha deb packages, from a git snapshot. It's not suitable for
+making upstreamable verions, but handy for your own local packages.
+
+Options:
+ --buildresult, -r
+ the location that the resulting .deb, .changes, etc. will be placed in.
+ Default is whatever pdebuild uses.
+ --distribution, -D
+ the distribution value to set in the changelog when editing it. Default
+ is 'squeeze-dev'.
+ --git-checks, -g
+ what level of git checks are run to determine if the working copy is
+ clean enough. One of 'all' (any changes are bad), 'modified' (only
+ tracked files with untracked changes will cause an error), and 'none'
+ (checking git status is skipped totally.) Default is 'all'.
+ --version, -v
+ the version string for the resulting package. Default is '$version'.
+ --(no)autoversion
+ whether or not to use the date and git commit ID in the version value.
+ Default is to include it.
+ --debug, -d
+EOH
+ exit;