1. Convert all remaining commands and areas within the program that used the
DB_File/Storable interface to DXUsers.pm to use the (hopefully) more stable
JSON text file + caching interface. Here's hoping.
+2. Add branch name to startup and sh/version.
16May20=======================================================================
1. Crontab can now spawn_cmd('export_users') - very safely.
15May20=======================================================================
push @call, DXUser::scan(sub {
my $k = shift;
- my $l = shift;
# cheat, don't decode because we can easily pull it out from the json test
- return $l =~ m{"sort":"[ACRSX]"} ? $k : ();
+ return $_[0] =~ m{"sort":"[ACRSX]"} ? $k : ();
});
}
} else {
my ($year) = (gmtime($main::systime))[5];
$year += 1900;
- push @out, "DX Spider Cluster version $main::version (build $main::build git: $main::gitversion) on \u$^O";
+ push @out, "DX Spider Cluster version $main::version (build $main::build git: $main::gitbranch/$main::gitversion) on \u$^O";
push @out, "Copyright (c) 1998-$year Dirk Koopman G1TLH";
}
+++ /dev/null
-#
-# Version information for DXSpider
-#
-# DO NOT ALTER THIS FILE. It is generated automatically
-# and will be overwritten
-#
-
-package main;
-
-use vars qw($version $build $gitversion);
-
-$version = '1.57';
-$build = '46';
-$gitversion = '855513b[i]';
-
-1;
use IO::File;
use Fcntl ':flock';
use POSIX ":sys_wait_h";
-use Version;
use Web;
+use vars qw($version $build $gitversion $gitbranch);
+
use Local;
$l->close_server;
}
- LogDbg('cluster', "DXSpider V$version, build $build (git: $gitversion) ended");
+ LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) ended");
dbg("bye bye everyone - bye bye");
dbgclose();
Logclose();
import Encode;
$can_encode = 1;
}
+ $gitbranch = 'none';
+ $gitversion = 'none';
eval { require Git; };
unless ($@) {
import Git;
$build = $b || 0;
$gitversion = "$g\[r]";
}
+ my @branch = $repo->command([qw{branch}], STDERR=>0);
+ for (@branch) {
+ my ($star, $b) = split /\s+/;
+ if ($star eq '*') {
+ $gitbranch = $b;
+ last;
+ }
+ }
}
}
$SIG{__DIE__} = $w;
# banner
my ($year) = (gmtime)[5];
$year += 1900;
- LogDbg('cluster', "DXSpider V$version, build $build (git: $gitversion) started");
+ LogDbg('cluster', "DXSpider V$version, build $build (git: $gitbranch/$gitversion) started");
dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH");
# load Prefixes
+++ /dev/null
-#!/usr/bin/env perl
-#
-# create a version and build id for the project using git ids
-#
-#
-#
-# Copyright (c) 2007 Dirk Koopman, G1TLH
-#
-
-# Determine the correct place to put stuff
-BEGIN {
- # root of directory tree for this system
- $root = "/spider";
- $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
-}
-
-use strict;
-
-use vars qw($root);
-my $fn = "$root/perl/Version.pm";
-my $desc = `git describe --long`;
-my ($v, $s, $b, $g) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
-$b++; # to account for the commit that is about to happen
-
-open F, ">$fn" or die "issue.pl: can't open $fn $!\n";
-print F qq(#
-# Version information for DXSpider
-#
-# DO NOT ALTER THIS FILE. It is generated automatically
-# and will be overwritten
-#
-
-package main;
-
-use vars qw(\$version \$build \$gitversion);
-
-\$version = '$v';
-\$build = '$b';
-\$gitversion = '$g\[i]';
-
-1;
-);
-
-exit(0);