]> dxcluster.org Git - spider.git/commitdiff
remove dependency on perl Git package
authorDirk Koopman <djk@tobit.co.uk>
Sat, 11 Dec 2021 12:54:59 +0000 (12:54 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 11 Dec 2021 12:54:59 +0000 (12:54 +0000)
Changes
perl/cluster.pl

diff --git a/Changes b/Changes
index bbd8c452b3c6c0fc227164b6d623e5a2c9d52161..ba3713da0d81064e18dd74088cf38cf2fb217e94 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+11Dec21=======================================================================
+1. Removed dependency on perl Git package.
 10Dec21=======================================================================
 1. Fix the output of set/dxgrid, set/usstate and set/dxcq or set/dxitu to how
    it was always supposed to be since 2003.
index 9416a7f3a8578769a2a4152895433646cc00cc8b..b942b44f9515ee034e22679e9a328c40f2f0820c 100755 (executable)
@@ -427,7 +427,7 @@ sub cease
                $l->close_server;
        }
 
-       LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) ended");
+       LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) on $^O ended");
        dbg("bye bye everyone - bye bye");
        dbgclose();
        Logclose();
@@ -513,26 +513,25 @@ sub setup_start
                        import Encode;
                        $can_encode = 1;
                }
+
                $gitbranch = 'none';
                $gitversion = 'none';
-               eval { require Git; };
-               unless ($@) {
-                       import Git;
                
-                       # determine the real version number
-                       my $repo = Git->repository(Directory => "$root/.git");
-                       if ($repo) {
-                               my $desc = $repo->command_oneline(['describe', '--long'], STDERR => 0);
-                               if ($desc) {
-                                       my ($v, $s, $b, $g) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
-                                       $s ||= '';
-                                       dbg("Git: $desc") if isdbg('git');
-                                       dbg("Git: V=$v S=$s B=$b g=$g") if isdbg('git');
-                                       $version = $v;
-                                       $build = $b || 0;
-                                       $gitversion = "$g\[r]";
-                               }
-                               my @branch = $repo->command([qw{branch}], STDERR=>0);
+               # determine the real Git build number and branch
+               my $desc;
+               eval {$desc = `git describe --long`};
+               if (!$@ && $desc) {
+                       my ($v, $s, $b, $g) = $desc =~ /^([\d\.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
+                       $version = $v;
+                       my $subversion = $s || 0; # not used elsewhere
+                       $build = $b || 0;
+                       $gitversion = "$g\[r]";
+               }
+               if (!$@) {
+                       my @branch;
+                       
+                       eval {@branch = `git branch`};
+                       unless ($@) {
                                for (@branch) {
                                        my ($star, $b) = split /\s+/;
                                        if ($star eq '*') {
@@ -542,6 +541,7 @@ sub setup_start
                                }
                        }
                }
+
                $SIG{__DIE__} = $w;
        }
 
@@ -557,7 +557,7 @@ sub setup_start
        # banner
        my ($year) = (gmtime)[5];
        $year += 1900;
-       LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) started");
+       LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) on $^O started");
        dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH");
 
        # load Prefixes