]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Migrate some stuff away from print_format.
authorSadie Powell <sadie@witchery.services>
Wed, 27 Jan 2021 16:47:08 +0000 (16:47 +0000)
committerSadie Powell <sadie@witchery.services>
Wed, 27 Jan 2021 16:47:08 +0000 (16:47 +0000)
configure
make/common.pm
make/console.pm
make/unit-cc.pl
tools/directive
tools/mkdescriptions
tools/mkheaders
vendor/update

index 029d566af0b1d435285405af9f31ceab55a28596..5d4520f31066e85ab9bedf009b3ef1ab589a6b71 100755 (executable)
--- a/configure
+++ b/configure
@@ -143,7 +143,7 @@ our $interactive = !(
 );
 
 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) {
@@ -433,7 +433,7 @@ $config{DISTRIBUTION} = $opt_distribution_label if $opt_distribution_label;
 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:
 
@@ -453,7 +453,7 @@ my @makeargs;
 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}
@@ -596,7 +596,7 @@ sub enable_extras(@) {
                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}|>: $!";
                }
        }
@@ -619,7 +619,7 @@ sub disable_extras(@) {
                } 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|>: $!";
                }
        }
index 38b77e215291f8d023e84ec1f2f0a046ebcfec49..519e7fba80ed8f2e0d5164c8feda76b025dee646 100644 (file)
@@ -45,7 +45,7 @@ sub create_directory($$) {
 }
 
 sub execute(@) {
-       print_format "<|BOLD \$|> @_\n";
+       say console_format "<|BOLD \$|> @_";
        return system @_;
 }
 
index 278c97d0f398b3175f30574e8ebe28b1e4c8364c..50df77ea50e741b095625696fe0a63e83e8fe374 100644 (file)
@@ -76,17 +76,17 @@ sub print_format($;$) {
 }
 
 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;
        }
 }
 
@@ -119,8 +119,8 @@ sub prompt_dir($$$;$) {
 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;
index f8991cb6755f54909203d35f5d3c713bef57502b..f555c3812f9814d833a8d4f2f69b41ce53b77885 100755 (executable)
@@ -57,9 +57,9 @@ exit 1;
 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";
        }
 }
 
index 07d4b09e2927782d1d1e9ae7fd773ca1f0d82ca3..c743ed3e67e3b15e923133e665b547fbf151b6b6 100755 (executable)
@@ -30,7 +30,7 @@ use make::console;
 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
 }
 
@@ -40,7 +40,7 @@ print_error "<|GREEN $file|> does not exist and/or is not a file!" unless -f $fi
 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;
        }
index bb6f011d8a11fb2d5fb4d901a378b44bf1ba1b51..5145422c0ec9604489162105a071c3bc71445379 100755 (executable)
@@ -35,7 +35,7 @@ use make::common;
 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;
 }
 
index 0ca59358474903e209288b5f598b58fcbd3d1aa0..f7b1247daddfa53f30e0fc42a4ad986ab188f3fd 100755 (executable)
@@ -50,7 +50,7 @@ for my $path (@paths) {
        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;
        }
 
@@ -68,7 +68,7 @@ for my $path (@paths) {
        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`) {
@@ -135,7 +135,7 @@ for my $path (@paths) {
                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};
        }
 }
 
index ca113ff29c29801a7f4297546080026b3bb3be61..3c04bc63af0bdea5e019b5454635a38b1871745e 100755 (executable)
@@ -43,7 +43,7 @@ my ($data, $error) = from_toml $contents;
 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;