groff-commit
[Top][All Lists]
Advanced

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

[groff] 21/39: [gpinyin]: Report groff version number as well.


From: G. Branden Robinson
Subject: [groff] 21/39: [gpinyin]: Report groff version number as well.
Date: Sun, 9 Oct 2022 23:53:38 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit d999ebec443352bdee7520ee95f8d33cb9410a59
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Oct 9 06:23:05 2022 -0500

    [gpinyin]: Report groff version number as well.
    
    * contrib/gpinyin/gpinyin.pl: Report groff version number along with
      this program's own when not run from source tree.  Drop dead code.
      Bump micro version number to reflect recent restructuring.
---
 contrib/gpinyin/ChangeLog  |  6 ++++++
 contrib/gpinyin/gpinyin.pl | 32 ++++----------------------------
 2 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/contrib/gpinyin/ChangeLog b/contrib/gpinyin/ChangeLog
index 08eb3c8fa..53cc22880 100644
--- a/contrib/gpinyin/ChangeLog
+++ b/contrib/gpinyin/ChangeLog
@@ -1,3 +1,9 @@
+2022-10-09  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * gpinyin.pl: Report groff version number along with this
+       program's own when not run from source tree.  Drop dead code.
+       Bump micro version number to reflect recent restructuring.
+
 2022-10-09  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Make gpinyin script stand alone.
diff --git a/contrib/gpinyin/gpinyin.pl b/contrib/gpinyin/gpinyin.pl
index 46cacbee3..73b303427 100755
--- a/contrib/gpinyin/gpinyin.pl
+++ b/contrib/gpinyin/gpinyin.pl
@@ -6,7 +6,8 @@
 
 # Written by Bernd Warken <groff-bernd.warken-72@web.de>.
 
-my $version = '1.0.4';
+my $version = '1.0.5';
+my $groff_version = '(groff @VERSION@) '; # with trailing space
 
 # This file is part of 'gpinyin', which is part of 'groff'.
 
@@ -54,34 +55,9 @@ use FindBin;
 
 $\ = "\n";     # final part for print command
 
-########################################################################
-# read-only variables with double-@ construct
-########################################################################
-
-our $File_split_env_sh;
-our $File_version_sh;
-our $Groff_Version;
-
-my $before_make;               # script before run of 'make'
 {
   my $at = '@';
-  $before_make = 1 if '@VERSION@' eq "${at}VERSION${at}";
-}
-
-my %at_at;
-my $file_gpinyin_test_pl;
-my $gpinyin_libdir;
-
-if ($before_make) {
-  my $gpinyin_source_dir = $FindBin::Bin;
-  $at_at{'BINDIR'} = $gpinyin_source_dir;
-  $at_at{'G'} = '';
-  $gpinyin_libdir = '@gpinyin_dir@';
-} else {
-  $at_at{'BINDIR'} = '@BINDIR@';
-  $at_at{'G'} = '@g@';
-  $gpinyin_libdir = '@gpinyin_dir@';
-  unshift(@INC, $gpinyin_libdir);
+  $groff_version = '' if '@VERSION@' eq "${at}VERSION${at}";
 }
 
 ########################################################################
@@ -651,7 +627,7 @@ foreach (@ARGV) {
       q(pinyin parts in 'roff' files.);
     exit;
   } elsif (/^(-v|--v|--ve|--ver|--vers|--versi|--versio|--version)$/) {
-    print q('gpinyin' version ) . $version;
+    print "gpinyin ${groff_version}version $version";
     exit;
   }
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]