added some extra cases for IOTA and QSL detection on sh/dx R_1_34
authordjk <djk>
Tue, 9 Nov 1999 23:01:44 +0000 (23:01 +0000)
committerdjk <djk>
Tue, 9 Nov 1999 23:01:44 +0000 (23:01 +0000)
added stat/db
added some help for databases

cmd/Aliases
cmd/Commands_en.hlp
cmd/dbstatus.pl [deleted file]
cmd/show/dx.pl
cmd/stat/db.pl [new file with mode: 0644]
perl/DXDb.pm
perl/Database.pm [deleted file]

index ef5172cce000cbae728aa938f846156bd2da5dc6..6ef3b166da989654ba50812b4268218fb2cd030e 100644 (file)
@@ -94,6 +94,7 @@ package CmdAlias;
          '^sh\w*/bu', 'show/files bulletins', 'show/files',
          '^sh\w*/c/n', 'show/configuration nodes', 'show/configuration',
          '^sh\w*/c$', 'show/configuration', 'show/configuration',
+         '^sh\w*/com', 'dbavail', 'dbavail',
          '^sh\w*/dx/(\d+)-(\d+)', 'show/dx $1-$2', 'show/dx',
          '^sh\w*/dx/(\d+)', 'show/dx $1', 'show/dx',
          '^sh\w*/dx/d(\d+)', 'show/dx from $1', 'show/dx',
index aec709dd16a98e8189fc35a5378375531f9bc65a..3964680fe8269f45294f61fce94d7c5bd13e42a8 100644 (file)
@@ -53,6 +53,110 @@ and to undo what you have just done:-
 
 which will arrange for them to be forward candidates again.
 
+=== 0^DBAVAIL^Show a list of all the Databases in the system
+Title says it all really, this command lists all the databases defined
+in the system. It is also aliased to SHOW/COMMAND.
+
+=== 9^DBCREATE <name>^Create a database entry
+=== 9^DBCREATE <name> chain <name> [<name>..]^Create a chained database entry
+=== 9^DBCREATE <name> remote <node>^Create a remote database entry
+DBCREATE allows you to define a database in the system. It doesn't actually
+create anything, just defines it.
+
+The databases that are created are simple DB_File hash databases, they are 
+therefore already 'indexed'.
+
+You can define a local database with the first form of the command eg:
+
+  DBCREATE oblast
+
+You can also chain databases with the addition of the 'chain' keyword. 
+This will search each database one after the other. A typical example 
+is:
+
+  DBCREATE sdx_qsl chain sql_ad
+
+No checking is done to see if the any of the chained databases exist, in
+fact it is usually better to do the above staement first then do each of
+the chained databases.
+
+Databases can exist offsite. To define a database that lives on another 
+node do:
+
+  DBCREATE buckmaster remote gb7dxc
+
+Remote databases cannot be chained; however, the last database in a 
+a chain can be a remote database eg:
+
+  DBCREATE qsl chain gb7dxc
+
+
+To see what databases have been defined do:
+
+  DBAVAIL (or it will have been aliased to SHOW/COMMAND)
+
+It would be normal for you to add an entry into your local Aliases file
+to allow people to use the 'SHOW/<dbname>' style syntax. So you would
+need to add a line like:-
+
+  's' => [
+    ..
+    ..
+    '^sh\w*/buc', 'dbshow buckmaster', 'dbshow',
+    ..
+    ..
+   ],
+
+to allow 
+  SH/BUCK g1tlh
+
+to work as they may be used to.
+
+See DBIMPORT for the importing of existing AK1A format data to databases.
+See DBSHOW for generic database enquiry
+=== 9^DBIMPORT <dbname> <filename>^Import AK1A data into a database
+If you want to import or update data in bulk to a database you can use
+this command. It will either create or update entries into an existing
+database. For example:-
+
+  DBIMPORT oblast /tmp/OBLAST.FUL
+
+will import the standard OBLAST database that comes with AK1A into the
+oblast database held locally.
+
+=== 9^DBREMOVE <dbname>^Delete a database
+DBREMOVE will completely remove a database entry and also delete any data
+file that is associated with it. 
+
+There is no warning, no comeback, no safety net. 
+
+For example:
+
+  DBREMOVE oblast 
+
+will remove the oblast database from the system and it will also remove
+the associated datafile.
+
+I repeat:
+
+There is no warning, no comeback, no safety net.
+You have been warned.
+
+=== 0^DBSHOW <dbname> <key>^Display an entry, if it exists, in a database
+This is the generic user interface to the database to the database system.
+It is expected that the sysop will add an entry to the local Aliases file
+so that users can use the more familiar AK1A style of enquiry such as:
+
+  SH/BUCK G1TLH
+
+but if he hasn't and the database really does exist (use DBAVAIL or
+SHOW/COMMAND to find out) you can do the same thing with:
+
+  DBSHOW buck G1TLH
+
 === 9^DEBUG^Set the cluster program into debug mode
 Executing this command will only have an effect if you are running the cluster
 in debug mode i.e.
@@ -553,12 +657,22 @@ Display the most recent WWV information that has been received by the system
 === 5^SHUTDOWN^Shutdown the cluster
 Shutdown the cluster and disconnect all the users 
 
+=== 5^STAT/DB <dbname>^Show the status of a database
+Show the internal status of a database descriptor.
+
+Depending on your privilege level you will see more or less information. 
+This command is unlikely to be of much use to anyone other than a sysop.
+
 === 5^STAT/CHANNEL [<callsign>]^Show the status of a channel on the cluster
 Show the internal status of the channel object either for the channel that 
 you are on or else for the callsign that you asked for.
 
 Only the fields that are defined (in perl term) will be displayed.
 
+=== 5^STAT/MSG <msgno>^Show the status of a message
+This command shows the internal status of a message and includes information
+such as to whom it has been forwarded, its size, origin etc etc.
+
 === 5^STAT/USER [<callsign>]^Show the full status of a user
 Shows the full contents of a user record including all the secret flags
 and stuff.
diff --git a/cmd/dbstatus.pl b/cmd/dbstatus.pl
deleted file mode 100644 (file)
index 34198bf..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/perl
-#
-# Database update routine
-#
-# Copyright (c) 1999 Dirk Koopman G1TLH
-#
-my ($self, $line) = @_;
-my @f = split /\s+/, $line;
-my @out;
-
-
-return (1, @out);
index a70ef50f66f7f2ac848eafd7e468e5e131732f2f..2af75e7ce09a21ae897bec57ee75f6424ed1e7c6 100644 (file)
@@ -65,12 +65,12 @@ while ($f = shift @list) {          # next field
                my ($a, $b);
 #              $DB::single =1;
                
-               if ($list[0] && (($a, $b) = $list[0] =~ /(AF|AN|NA|SA|EU|AS|OC)-?(\d\d\d)/oi)) {
+               if ($list[0] && (($a, $b) = $list[0] =~ /(AF|AN|NA|SA|EU|AS|OC)-?(\d?\d\d)/oi)) {
                        $a = uc $a;
                        $doiota = "\\b$a\[\-\ \]\?$b\\b";
                        shift @list;
                }
-               $doiota = '\b(IOTA|(AF|AN|NA|SA|EU|AS|OC)[- ]?\d\d\d)\b' unless $doiota;
+               $doiota = '\b(IOTA|(AF|AN|NA|SA|EU|AS|OC)[- ]?\d?\d\d)\b' unless $doiota;
                next;
        }
        if (lc $f eq 'qra') {
@@ -121,7 +121,7 @@ if ($spotter) {
 # qsl requests
 if ($doqsl) {
        $expr .= " && " if $expr;
-       $expr .= "\$f3 =~ m{(QSL|VIA)}io";
+       $expr .= "\$f3 =~ m{(\@|>|QSL|VIA)}io";
 }
 
 # iota requests
diff --git a/cmd/stat/db.pl b/cmd/stat/db.pl
new file mode 100644 (file)
index 0000000..04240cd
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# show all the values in a db fcb
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @list = split /\s+/, $line;               # generate a list of msg nos
+my @out;
+
+return (1, $self->msg('e5')) if $self->priv < 5;
+return (1, $self->msg('m16')) if @list == 0;
+
+foreach my $name (@list) {
+  my $ref = DXDb::getdesc($name);
+  if ($ref) {
+    @out = print_all_fields($self, $ref, "DB Parameters $name");
+  } else {
+    push @out, $self->msg('db3', $name);
+  }
+  push @out, "" if @list > 1;
+}
+
+return (1, @out);
index bccfb6ddac951140481687ca9f36cad5e6f50541..25e7c0827d3f0d2d0d7fd7f30d32c59ab60640ca 100644 (file)
@@ -21,24 +21,27 @@ $opentime = 5*60;                           # length of time a database stays open after last access
 $dbbase = "$main::root/db";            # where all the databases are kept;
 %avail = ();                                   # The hash contains a list of all the databases
 %valid = (
-                 accesst => '9,Last Access Time,atime',
+                 accesst => '9,Last Accs Time,atime',
                  createt => '9,Create Time,atime',
-                 lastt => '9,Last Update Time,atime',
+                 lastt => '9,Last Upd Time,atime',
                  name => '0,Name',
                  db => '9,DB Tied hash',
                  remote => '0,Remote Database',
-                 pre => '0,Heading text',
-                 post => '0,Tail text',
+                 pre => '0,Heading txt',
+                 post => '0,Tail txt',
                  chain => '0,Search these,parray',
                  disable => '0,Disabled?,yesno',
-                 nf => '0,Not Found text',
-                 cal => '0,No Key text',
-                 allowread => '9,Allowed to read,parray',
-                 denyread => '9,Deny to read,parray',
-                 allowupd => '9,Allow to update,parray',
-                 denyupd => '9,Deny to update,parray',
-                 fwdupd => '9,Forward updates to,parray',
+                 nf => '0,Not Found txt',
+                 cal => '0,No Key txt',
+                 allowread => '9,Allowed read,parray',
+                 denyread => '9,Deny read,parray',
+                 allowupd => '9,Allow upd,parray',
+                 denyupd => '9,Deny upd,parray',
+                 fwdupd => '9,Forw upd to,parray',
                  template => '9,Upd Templates,parray',
+                 te => '9,End Upd txt',
+                 tae => '9,End App txt',
+                 atemplate => '9,App Templates,parray',
                  help => '0,Help txt,parray',
                 );
 
@@ -97,7 +100,7 @@ sub getdesc
 
        # search for a partial if not found direct
        unless ($r) {
-               for (values %avail) {
+               for (sort { $a->{name} cmp $b->{name} }values %avail) {
                        if ($_->{name} =~ /^$name/) {
                                $r = $_;
                                last;
diff --git a/perl/Database.pm b/perl/Database.pm
deleted file mode 100644 (file)
index e69de29..0000000