improve links cmd. fix UPGRADE.mojo
authorDirk Koopman <djk@tobit.co.uk>
Sun, 31 May 2020 10:43:39 +0000 (11:43 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sun, 31 May 2020 10:43:39 +0000 (11:43 +0100)
Changes
UPGRADE.mojo
cmd/links.pl
perl/DXUtil.pm

diff --git a/Changes b/Changes
index 50788fd91c79293bfd7cae5354b2181bdb5586c2..4d161b0083f0d041d76d6034612f51724126177d 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+31May20=======================================================================
+1. Improve links command layout slightly.
+2. Issue an *accurate* UPGRADE.mojo with all the new packages included! 
 30May20=======================================================================
 1. Fix sh/dx! It appears that there is a long standing problem with sh/dx not
    actually return all the answers it should. I have also had a request to
 29May20=======================================================================
 1. Please install Math::Round and Data::Structure::Util. Instructions are
    available in UPGRADE.mojo.
-2. Notwithstanding item 1 below. I have decided to keep DB_File but ditch
-   Storable. The current users.v3 will be converted, automatically, to 
-   users.v3j on startup. After this is done a 'user_json' file (the 
-   replacement for 'user_asc') will also be generated. 
+2. ** Withdrawn ** user file format change to json not yet committed.
 20May20=======================================================================
 1. Backport convert-users-v3-to-v4.pl to allow creation of the new json 
    formatted *text* based user file from the old v3 DB_File and Storable 
index 5e5a402e14505a139bb6ee526e992df785a9f416..c42313dc4b114b99f14eb7067c4803b9e36744b4 100644 (file)
@@ -56,7 +56,7 @@ You will need the following CPAN packages:
        If you are on a Debian based system (Devuan, Ubuntu, Mint etc) that is reasonably new (I use Ubuntu
        18.04 and Debian 10) then you can simply do:
 
-       sudo apt-get install libev-perl libmojolicious-perl libjson-perl libjson-xs-perl libdata-structure-util-perl
+       sudo apt-get install libev-perl libmojolicious-perl libjson-perl libjson-xs-perl libdata-structure-util-perl libmath-round-perl
 
     or on Redhat based systems you can install the very similarly (but not the same) named
        packages. I don't the exact names but using anything less than Centos 7 is likely to cause
@@ -68,7 +68,7 @@ You will need the following CPAN packages:
        
        sudo apt-get install build-essential.
 
-       sudo cpanm EV Mojolicious JSON JSON::XS Data::Structure::Util
+       sudo cpanm EV Mojolicious JSON JSON::XS Data::Structure::Util Math::Round
        
        # just in case it's missing
        sudo apt-get install top
index f35545577dce2dd9f78eff231af216ed1428eb3c..641f977bc1774deaf7014c98ca7aaaa3606f05eb 100644 (file)
@@ -18,9 +18,10 @@ my $nowt = time;
 push @out, "                                                  Ave  Obs  Ping  Next      Filters";
 push @out, "  Callsign Type Started                 Uptime    RTT Count Int.  Ping Iso? In  Out PC92? Address";
 
-foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) {
-       my $call = $dxchan->call();
+foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) {
        next if $dxchan == $main::me;
+       next unless $dxchan->is_node || $dxchan->is_rbn;
+       my $call = $dxchan->call();
        my $t = cldatetime($dxchan->startt);
        my $sort;
        my $name = $dxchan->user->name || " ";
@@ -44,7 +45,7 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) {
        }
        unless ($pingint) {
                $lastt = 0;
-               $ping = "        ";
+               $ping = "       ";
        }
 
        $sort = "DXSP" if $dxchan->is_spider;
@@ -52,6 +53,7 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_nodes ) {
        $sort = "DXNT" if $dxchan->is_dxnet;
        $sort = "AR-C" if $dxchan->is_arcluster;
        $sort = "AK1A" if $dxchan->is_ak1a;
+       $sort = "RBN " if $dxchan->is_rbn;
        my $ipaddr;
 
        my $addr = $dxchan->hostname;
index e77eb2947d80f8db249dc109c984ff070243b8cf..e93d7ab4e6d87bd37e1d07c88f4e0fd748dc8c64 100644 (file)
@@ -386,7 +386,7 @@ sub is_callsign
                                          (?:\d?[A-Z]{1,2}\d*/)?    # out of area prefix /  
                                          (?:\d?[A-Z]{1,2}\d+)      # main prefix one (required) 
                                          [A-Z]{1,5}                # callsign letters (required)
-                                         (?:-(?:\d{1,2}|\#))?      # - nn possibly (eg G8BPQ-8) or -# (an RBN spot) 
+                                         (?:-(?:\d{1,2}))?         # - nn possibly (eg G8BPQ-8)
                                          (?:/[0-9A-Z]{1,7})?       # / another prefix, callsign or special label (including /MM, /P as well as /EURO or /LGT) possibly
                                          $!x;
 
@@ -554,15 +554,14 @@ sub difft
        $t -= $d * 86400;
        $h = int $t / 3600;
        $out .= sprintf ("%s${h}h", $adds?' ':'') if $h;
-#      $out .= "${h}h" if $h || $d;
        $t -= $h * 3600;
        $m = int $t / 60;
        $out .= sprintf ("%s${m}m", $adds?' ':'') if $m;
-#      $out .= "${m}m" if $m || $h || $d;
-       $s = int $t % 60;
-       $out .= sprintf ("%s${s}s", $adds?' ':'') if $s;
-       #       $out .= "${s}s";
-       $out ||= sprintf ("%s0s", $adds?' ':'');
+       if ($d == 0 && $adds || $adds == 2) {
+               $s = int $t % 60;
+               $out .= sprintf ("%s${s}s", $adds?' ':'') if $s;
+               $out ||= sprintf ("%s0s", $adds?' ':'');
+       }
        return $out;
 }