[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/02: lintian: Extend --perf-output to allow "append" mode



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 325cf9c52f757b41309b51cc370dbc2a9ed18432
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Oct 16 17:23:57 2014 +0200

    lintian: Extend --perf-output to allow "append" mode
    
    Accept "+my-file" as "append to my-file" rather than "truncate
    my-file".
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 frontend/lintian   |  4 +++-
 man/lintian.pod.in | 25 +++++++++++++++++++++----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/frontend/lintian b/frontend/lintian
index 4e31f9c..fb88cbe 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -907,7 +907,9 @@ if (my $perf_log = $opt{'perf-output'}) {
     if ($perf_log =~ m/^&\d+/) {
         open($fd, '>>&=', substr($perf_log, 1));
     } else {
-        open($fd, '>', $perf_log);
+        my $mode = '>';
+        $mode = '>>' if $perf_log =~ s/^\+//;
+        open($fd, $mode, $perf_log);
     }
     $Lintian::Output::GLOBAL->perf_log_fd($fd);
 
diff --git a/man/lintian.pod.in b/man/lintian.pod.in
index afedd80..098cd0f 100644
--- a/man/lintian.pod.in
+++ b/man/lintian.pod.in
@@ -477,12 +477,29 @@ release.
 Note that some of the information may also be available (possibly in
 a different format) with the B<--debug> option.
 
-=item B<--perf-output> X
+=item B<--perf-output> OUTPUT
 
-Write performance related debug information to the specified file
-or (if prefixed with "&") file descriptor (e.g. '&3').
+Write performance related debug information to the specified file or
+file descriptor.  If OUTPUT starts with a '&' or '+', Lintian will
+handle OUTPUT specially.  Otherwise, Lintian will open the file
+denoted by OUTPUT for writing (truncating if it exists, creating it
+if it does not exist).
 
-If given a file, the file will be truncated if it exists.
+If the first character of OUTPUT is a & and the rest of argument is a
+number N, then lintian attempts to write it to the file descriptor
+with the number N.  Said file descriptor must be open for writing.
+E.g I<&2> makes Lintian write the performance logging to STDERR.
+
+If the first character of OUTPUT is a +, Lintian will append to the
+file rather than truncating it.  In this case, the file name is OUTPUT
+with initial "+" character removed.  E.g. I<+my-file> makes Lintian
+append to I<my-file>
+
+If Lintian should write the output to a file starting with a literal
+'&' or '+', then simply prefix it with "./" (e.g. "+my-file" becomes
+"./+my-file").
+
+If this option omitted, Lintian will default to using STDOUT.
 
 =item B<--root> rootdir
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: