3

When Build.pl of some Perl project is run on systems not used for Perl development before, it interrupts again and again if the user would like to prepend certain packages to the installation.

Is there any way to get a non-interactive default run of the Build.PL without having to watch it for hours and press 'enter' again and again?

dronus
  • 10,774
  • 8
  • 54
  • 80

1 Answers1

4

PERL_MM_USE_DEFAULT=1

If set to a true value then MakeMaker's prompt function will always return the default without waiting for user input.

Works the same in Module::Build.


PERL_EXTUTILS_AUTOINSTALL=--default-deps

--alldeps will install all features, while --defaultdeps will only install features for which the default answer is 'y'.


If you use CPAN, also configure prerequisites_policy=follow.

This takes care of most prompts. There are a couple of bad apples that still require some form of human intervention. Distroprefs take care of them, see the distroprefs directory.

daxim
  • 39,270
  • 4
  • 65
  • 132
  • That done it. It however installed also 'recommended' packages too what I don't wanted. And I don't understand why this is not explained by the usage printout of Build.PL. – dronus Aug 14 '12 at 19:53
  • Because that idea did not occur to anyone yet. If you want that feature, [file a bug](https://rt.cpan.org/Dist/Display.html?Name=Module-Build). – daxim Aug 14 '12 at 19:59
  • Maybe then I did something the wrong way? I expected this problem to arise for anyone who downloads a Perl project's source and try to build it. – dronus Aug 14 '12 at 22:17
  • Most people don't install manually, but install compiled packages from their OS/Perl distributor or use a CPAN client. – daxim Aug 15 '12 at 12:30
  • Ok.. so there is no 'silent default' build for an Perl project like others have with `./configure`, `make` or something like that? Or is it becuase my Ubuntu is lacking so much Perl packages that are considered available by default? – dronus Aug 16 '12 at 13:53
  • I read your last comment questions five times now and I still don't understand what you're trying to convey. – daxim Aug 16 '12 at 15:02
  • Sorry, I would like to know if my distribution was making the build process unusual interactive, or if it is usual for Perl projects to require this high amount of interactivity compared to other build processes where one or two commands will build the project in some default manner. – dronus Aug 16 '12 at 16:05
  • No, Ubuntu's Perl does not make module building more interactive than normal. Yes, it is not unusual for Perl module building to require interactivity. This is why the automatisms mentioned my answer exist. – daxim Aug 16 '12 at 16:33