);
my %version = get_version $opt_distribution_label;
-print_format "<|BOLD Configuring InspIRCd $version{FULL} on $^O.|>\n";
+say console_format "<|BOLD Configuring InspIRCd $version{FULL} on $^O.|>";
my %config;
if ($interactive) {
write_configure_cache %config;
parse_templates \%config, \%compiler, \%version;
-print_format <<"EOM";
+print console_format <<"EOM";
Configuration is complete! You have chosen to build with the following settings:
push @makeargs, "-C${\abs2rel $RealDir}" unless getcwd eq $RealDir;
push @makeargs, "-j${\(get_cpu_count() + 1)}";
-print_format <<"EOM";
+say console_format <<"EOM";
<|GREEN Paths:|>
<|GREEN Base:|> $config{BASE_DIR}
if (-e $modulepath) {
print_error "unable to symlink <|GREEN ${\abs2rel $modulepath}|> to <|GREEN ${\abs2rel $extrapath}|>: the target exists and is not a symlink.";
} else {
- print_format "Enabling the <|GREEN $shortname|> module ...\n";
+ say console_format "Enabling the <|GREEN $shortname|> module ...";
symlink $extrapath, $modulepath or print_error "unable to symlink <|GREEN ${\abs2rel $modulepath}|> to <|GREEN ${\abs2rel $extrapath}|>: $!";
}
}
} elsif ((-e $modulepath && !-e $extrapath) || !-l $modulepath) {
print_error "the <|GREEN $shortname|> module is not an extra module!";
} else {
- print_format "Disabling the <|GREEN $shortname|> module ...\n";
+ say console_format "Disabling the <|GREEN $shortname|> module ...";
unlink $modulepath or print_error "unable to unlink <|GREEN $extrapath|>: $!";
}
}
}
sub execute(@) {
- print_format "<|BOLD \$|> @_\n";
+ say console_format "<|BOLD \$|> @_";
return system @_;
}
}
sub print_error {
- print_format "<|RED Error:|> ", *STDERR;
+ print STDERR console_format "<|RED Error:|> ";
for my $line (@_) {
- print_format "$line\n", *STDERR;
+ say STDERR console_format $line;
}
exit 1;
}
sub print_warning {
- print_format "<|YELLOW Warning:|> ", *STDERR;
+ print STDERR console_format "<|YELLOW Warning:|> ";
for my $line (@_) {
- print_format "$line\n", *STDERR;
+ print STDERR console_format $line;
}
}
sub prompt_string($$$) {
my ($interactive, $question, $default) = @_;
return $default unless $interactive;
- print_format "$question\n";
- print_format "[<|GREEN $default|>] => ";
+ say console_format $question;
+ say console_format "[<|GREEN $default|>] => ";
chomp(my $answer = <STDIN>);
say '';
return $answer ? $answer : $default;
sub message($$$) {
my ($type, $file, $command) = @_;
if ($ENV{INSPIRCD_VERBOSE}) {
- print "$command\n";
+ say $command;
} else {
- print_format "\t<|GREEN $type:|>\t\t$file\n";
+ say console_format "\t<|GREEN $type:|>\t\t$file";
}
}
use make::directive;
if (scalar @ARGV < 2) {
- print_format "<|GREEN Usage:|> $0 <<|UNDERLINE FILE|>> [<|UNDERLINE DIRECTIVES...|>]\n", *STDERR;
+ say STDERR console_format "<|GREEN Usage:|> $0 <<|UNDERLINE FILE|>> [<|UNDERLINE DIRECTIVES...|>]";
exit 1
}
for my $directive (@ARGV) {
my $value = get_directive $file, $directive, '';
if (-t STDOUT) {
- print_format "<|GREEN $directive|>: $value\n";
+ say console_format "<|GREEN $directive|>: $value";
} else {
say $value;
}
use make::console;
unless (scalar @ARGV) {
- print_format "<|GREEN Usage:|> $0 <<|UNDERLINE DOCS-SITE|>>\n", *STDERR;
+ say STDERR console_format "<|GREEN Usage:|> $0 <<|UNDERLINE DOCS-SITE|>>";
exit 1;
}
next if $path =~ /\/vendor\//;
if (system "git ls-files --error-unmatch -- $path 1>/dev/null 2>/dev/null") {
- print_format "Skipping <|YELLOW $path|> as it has not been committed.\n" if defined $ENV{MKHEADERS_VERBOSE};
+ say STDERR console_format "Skipping <|YELLOW $path|> as it has not been committed." if defined $ENV{MKHEADERS_VERBOSE};
next;
}
close $fh;
if (defined $copyright) {
- print_format "Updating copyright headers in <|GREEN $path|>.\n" if defined $ENV{MKHEADERS_VERBOSE};
+ say console_format "Updating copyright headers in <|GREEN $path|>." if defined $ENV{MKHEADERS_VERBOSE};
my (%author, %authors);
my $ignored_args = join ' ', map { "--ignore-rev $_" } @ignored_revisions;
for my $line (split /\n+/, `git blame $ignored_args --incremental -w HEAD -- $path`) {
close $fh;
push @updated, $path;
} else {
- print_format "Skipping <|YELLOW $path|> as it contains no copyright headers.\n" if defined $ENV{MKHEADERS_VERBOSE};
+ say STDERR console_format "Skipping <|YELLOW $path|> as it contains no copyright headers." if defined $ENV{MKHEADERS_VERBOSE};
}
}
print_error "unable to parse $config: $!" if $error;
while (my ($name, $info) = each %{$data}) {
- print_format "Updating <|GREEN $name|> ...\n";
+ say console_format "Updating <|GREEN $name|> ...";
my $unpackdir = File::Temp->newdir;
my $vendordir = catdir $RealDir, $name;