use warnings;
use Software::LicenseUtils;
+use Getopt::Long qw(:config gnu_getopt);
+
+GetOptions(
+ "o|output=s" => \(my $output = '-'),
+) or die("Error in command line arguments!\n");
my ($authors, @licenses) = @ARGV;
+my $out;
+if ($output eq '-') {
+ $out = \*STDOUT;
+}
+else {
+ open $out, '>', $output
+ or die "Unable to write to $output: $!\n";
+}
+
my %uniq;
-print
+print { $out }
join "\n\n",
map { $_->new({holder => $authors})->license }
grep { !$uniq{$_}++ }
$(NOECHO) cpan-upload -h $(DEV_NULL_STDOUT)
releasetest:
$(MAKE) disttest RELEASE_TESTING=1 DISTTEST_MAKEFILE_PARAMS="PREREQ_FATAL=1" PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\""
+ $(NOECHO) $(TEST_F) $(DISTVNAME)/LICENSE || $(ECHO) "Failed to generate $(DISTVNAME)/LICENSE!" >&2
+ $(NOECHO) $(TEST_F) $(DISTVNAME)/LICENSE
release: preflight
$(MAKE) releasetest
$(GET_CHANGELOG) -p"Release commit for $(VERSION)" | git commit -a -F -
$(NOECHO) $(ABSPERLRUN) $(HELPERS)/add-to-manifest -d $(DISTVNAME) README
distsignature: readmefile licensefile
licensefile: create_distdir
- $(NOECHO) $(TEST_F) $(DISTVNAME)/LICENSE || $(MAKE) $(DISTVNAME)/LICENSE
+ $(NOECHO) $(TEST_F) $(DISTVNAME)/LICENSE || $(MAKE) $(DISTVNAME)/LICENSE || $(TRUE)
$(DISTVNAME)/LICENSE: Makefile.PL
$(NOECHO) $(MKPATH) $(DISTVNAME)
- $(ABSPERLRUN) $(HELPERS)/generate-license $(AUTHORS) $(LICENSES) >$(DISTVNAME)/LICENSE
+ $(ABSPERLRUN) $(HELPERS)/generate-license -o $(DISTVNAME)/LICENSE $(AUTHORS) $(LICENSES)
$(NOECHO) $(ABSPERLRUN) $(HELPERS)/add-to-manifest -d $(DISTVNAME) LICENSE
disttest: distmanicheck
distmanicheck: create_distdir