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

[lintian] 06/13: spellintian: Use the same version as lintian



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

nthykier pushed a commit to branch master
in repository lintian.

commit 1d43c48058f8251c9c9dedd1d581e8558efbda5c
Author: Niels Thykier <niels@thykier.net>
Date:   Fri Jun 19 23:11:20 2015 +0200

    spellintian: Use the same version as lintian
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 commands/spellintian.pm |  7 ++++---
 frontend/dplint         | 18 +++++++++++-------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/commands/spellintian.pm b/commands/spellintian.pm
index 0972bc1..6fb1e75 100644
--- a/commands/spellintian.pm
+++ b/commands/spellintian.pm
@@ -29,10 +29,9 @@ use Lintian::Data;
 use Lintian::Profile;
 use Lintian::Util qw(slurp_entire_file);
 
-our $VERSION = '0.0';
-
 sub show_version {
-    print "spellintian $VERSION\n";
+    my $version = dplint::lintian_version();
+    print "spellintian v${version}\n";
     exit 0;
 }
 
@@ -97,6 +96,8 @@ END {
     close(STDERR);
 }
 
+1;
+
 # Local Variables:
 # indent-tabs-mode: nil
 # cperl-indent-level: 4
diff --git a/frontend/dplint b/frontend/dplint
index 60345a8..2cfa288 100755
--- a/frontend/dplint
+++ b/frontend/dplint
@@ -244,14 +244,19 @@ sub main {
     error('run_tool returned unexpectedly');
 }
 
-sub builtin_version {
-    my ($truename, $cmd, @args) = @_;
+sub lintian_version {
     $LINTIAN_VERSION = guess_version(__FILE__)
       if not defined($LINTIAN_VERSION);
+    return $LINTIAN_VERSION;
+}
+
+sub builtin_version {
+    my ($truename, $cmd, @args) = @_;
+    my $version = lintian_version();
     if ($cmd eq 'print-version') {
-        print "$LINTIAN_VERSION\n";
+        print "${version}\n";
     } else {
-        print "Lintian v$LINTIAN_VERSION\n";
+        print "Lintian v${version}\n";
     }
     exit(0);
 }
@@ -259,10 +264,9 @@ sub builtin_version {
 sub builtin_help {
     my ($truename, $cmd, @args) = @_;
     my $me = basename($0);
-    $LINTIAN_VERSION = guess_version(__FILE__)
-      if not defined($LINTIAN_VERSION);
+    my $version = lintian_version();
     print <<"EOT";
-Lintian v$LINTIAN_VERSION
+Lintian v${version}
 Usage: $me [General options] <command> [options/arguments...]
 General options:
   --include-dir DIR     include checks, libraries (etc.) from DIR

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


Reply to: