X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Fdirective.pm;h=0c789ebf4c05fecad0ef434e143086a58ca2ccca;hb=4a126ad130b0a51449343de2f2db6becca0d2819;hp=c0c2aee85039bb297ba9f016d8fb233ab032276f;hpb=87b1461e2a4710a38b32186c2582da9fe9bb3804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/directive.pm b/make/directive.pm index c0c2aee85..0c789ebf4 100644 --- a/make/directive.pm +++ b/make/directive.pm @@ -1,7 +1,7 @@ # # InspIRCd -- Internet Relay Chat Daemon # -# Copyright (C) 2016 Peter Powell +# Copyright (C) 2016-2020 Sadie Powell # # This file is part of InspIRCd. InspIRCd is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public @@ -27,7 +27,7 @@ use feature ':5.10'; use strict; use warnings FATAL => qw(all); -use File::Basename qw(basename dirname); +use File::Basename qw(dirname); use File::Spec::Functions qw(catdir); use Exporter qw(import); @@ -124,11 +124,15 @@ sub __error { } else { push @message, 'If you believe this error to be a bug then you can file a bug report'; push @message, 'at https://github.com/inspircd/inspircd/issues'; + push @message, ''; + push @message, 'You can also refer to the documentation page for this module at'; + push @message, "https://docs.inspircd.org/3/modules/${\module_shrink $file}"; } push @message, ''; push @message, 'If you would like help with fixing this problem then visit our IRC'; - push @message, 'channel at irc.inspircd.org #InspIRCd for support.'; + push @message, 'channel at irc.inspircd.org #InspIRCd or create a support discussion'; + push @message, 'at https://github.com/inspircd/inspircd/discussions.'; push @message, ''; print_error @message; @@ -174,25 +178,25 @@ sub __function_find_compiler_flags { # Try to look up the compiler flags with pkg-config... chomp(my $flags = `pkg-config --cflags $name ${\DIRECTIVE_ERROR_PIPE}`); unless ($?) { - print_format "Found the <|GREEN $name|> compiler flags for <|GREEN ${\basename $file, '.cpp'}|> using pkg-config: <|BOLD $flags|>\n"; + print_format "Found the <|GREEN $name|> compiler flags for <|GREEN ${\module_shrink $file}|> using pkg-config: <|BOLD $flags|>\n"; return $flags; } # If looking up with pkg-config fails then check the environment... my $key = __environment 'INSPIRCD_CXXFLAGS_', $name; if (defined $ENV{$key}) { - print_format "Found the <|GREEN $name|> compiler flags for <|GREEN ${\basename $file, '.cpp'}|> using the environment: <|BOLD $ENV{$key}|>\n"; + print_format "Found the <|GREEN $name|> compiler flags for <|GREEN ${\module_shrink $file}|> using the environment: <|BOLD $ENV{$key}|>\n"; return $ENV{$key}; } # If all else fails then look for the defaults.. if (defined $defaults) { - print_format "Using the default <|GREEN $name|> compiler flags for <|GREEN ${\basename $file, '.cpp'}|>: <|BOLD $defaults|>\n"; + print_format "Using the default <|GREEN $name|> compiler flags for <|GREEN ${\module_shrink $file}|>: <|BOLD $defaults|>\n"; return $defaults; } # We can't find it via pkg-config, via the environment, or via the defaults so give up. - __error $file, "unable to find the <|GREEN $name|> compiler flags for <|GREEN ${\basename $file, '.cpp'}|>!"; + __error $file, "unable to find the <|GREEN $name|> compiler flags for <|GREEN ${\module_shrink $file}|>!"; } sub __function_find_linker_flags { @@ -201,25 +205,25 @@ sub __function_find_linker_flags { # Try to look up the linker flags with pkg-config... chomp(my $flags = `pkg-config --libs $name ${\DIRECTIVE_ERROR_PIPE}`); unless ($?) { - print_format "Found the <|GREEN $name|> linker flags for <|GREEN ${\basename $file, '.cpp'}|> using pkg-config: <|BOLD $flags|>\n"; + print_format "Found the <|GREEN $name|> linker flags for <|GREEN ${\module_shrink $file}|> using pkg-config: <|BOLD $flags|>\n"; return $flags; } # If looking up with pkg-config fails then check the environment... my $key = __environment 'INSPIRCD_CXXFLAGS_', $name; if (defined $ENV{$key}) { - print_format "Found the <|GREEN $name|> linker flags for <|GREEN ${\basename $file, '.cpp'}|> using the environment: <|BOLD $ENV{$key}|>\n"; + print_format "Found the <|GREEN $name|> linker flags for <|GREEN ${\module_shrink $file}|> using the environment: <|BOLD $ENV{$key}|>\n"; return $ENV{$key}; } # If all else fails then look for the defaults.. if (defined $defaults) { - print_format "Using the default <|GREEN $name|> linker flags for <|GREEN ${\basename $file, '.cpp'}|>: <|BOLD $defaults|>\n"; + print_format "Using the default <|GREEN $name|> linker flags for <|GREEN ${\module_shrink $file}|>: <|BOLD $defaults|>\n"; return $defaults; } # We can't find it via pkg-config, via the environment, or via the defaults so give up. - __error $file, "unable to find the <|GREEN $name|> linker flags for <|GREEN ${\basename $file, '.cpp'}|>!"; + __error $file, "unable to find the <|GREEN $name|> linker flags for <|GREEN ${\module_shrink $file}|>!"; } sub __function_require_compiler { @@ -287,18 +291,18 @@ sub __function_vendor_directory { # Try to look the directory up in the environment... my $key = __environment 'INSPIRCD_VENDOR_', $name; if (defined $ENV{$key}) { - print_format "Found the <|GREEN $name|> vendor directory for <|GREEN ${\basename $file, '.cpp'}|> using the environment: <|BOLD $ENV{$key}|>\n"; + print_format "Found the <|GREEN $name|> vendor directory for <|GREEN ${\module_shrink $file}|> using the environment: <|BOLD $ENV{$key}|>\n"; return $ENV{$key}; } my $directory = catdir(VENDOR_DIRECTORY, $name); if (-d $directory) { - print_format "Using the default <|GREEN $name|> vendor directory for <|GREEN ${\basename $file, '.cpp'}|>: <|BOLD $directory|>\n"; + print_format "Using the default <|GREEN $name|> vendor directory for <|GREEN ${\module_shrink $file}|>: <|BOLD $directory|>\n"; return $directory; } # We can't find it via the environment or via the filesystem so give up. - __error $file, "unable to find the <|GREEN $name|> vendor directory for <|GREEN ${\basename $file, '.cpp'}|>!"; + __error $file, "unable to find the <|GREEN $name|> vendor directory for <|GREEN ${\module_shrink $file}|>!"; } sub __function_warning {