diff options
author | rillig <rillig@pkgsrc.org> | 2006-04-30 21:31:32 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-04-30 21:31:32 +0000 |
commit | dc39fd32e2fd682f02f4bbc40de347a7f8eac227 (patch) | |
tree | 5bc7c625bd9227fc6863f84bd219116ad0ea886c /pkgtools | |
parent | 1df68ec8fdf4cfd595a544a58b6c8d01a7d7eec7 (diff) | |
download | pkgsrc-dc39fd32e2fd682f02f4bbc40de347a7f8eac227.tar.gz |
Added a warning that shell commands should not be hidden unconditionally
(by starting with the @ character).
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 4f1d27825a0..91f4c5a0b17 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.565 2006/04/29 10:12:36 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.566 2006/04/30 21:31:32 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -2752,7 +2752,14 @@ sub checkline_mk_shelltext($$) { } $vartools = get_vartool_names(); - ($rest = $text) =~ s/^[-@]*(?:\$\{_PKG_SILENT\})?(?:\$\{_PKG_DEBUG\})?//; + $rest = $text; + if ($rest =~ s/^([-@]*)(?:\$\{_PKG_SILENT\}\$\{_PKG_DEBUG\})?//) { + my ($hidden) = ($1); + if ($hidden =~ qr"\@") { + $line->log_warning("Shell commands should not be hidden unconditionally."); + } + } + $state = SCST_START; $set_e_mode = false; while ($rest =~ s/^$regex_shellword//) { |