chiark / gitweb /
'plugins' and other _accum configuration items can now have the list
authorRichard Kettlewell <richard@deodand>
Fri, 23 Nov 2007 14:15:43 +0000 (14:15 +0000)
committerRichard Kettlewell <richard@deodand>
Fri, 23 Nov 2007 14:15:43 +0000 (14:15 +0000)
cleared by supplying no arguments.  This is used by the test scripts to
ensure they aren't picking up install versions of the plugins.

This is on disorder.unicode rather than disorder.dev because the tests
that matter are all there...

doc/disorder_config.5.in
lib/configuration.c
tests/dtest.py

index f73f0bfbbed2a4c0f023448c46b20d683048fd5f..badedebca2b7b6355f125d6c450fd8f3432f064d 100644 (file)
@@ -126,6 +126,10 @@ interface.)
 Plugins are opened the first time they are required and never after,
 so after changing a plugin you must restart the server before it is
 guaranteed to take effect.
+.IP
+If
+.B plugins
+is used without arguments the plugin path is cleared.
 .SS "Server Configuration"
 .TP
 .B alias \fIPATTERN\fR
@@ -326,6 +330,10 @@ For the server to be able to calculate track lengths, there should be a
 command corresponding to each
 .B player
 command.
+.IP
+If
+.B player
+is used without arguments, the list of players is cleared.
 .TP
 .B prefsync \fISECONDS\fR
 The interval at which the preferences log file will be synchronised.  Defaults
@@ -440,14 +448,23 @@ Scratches are played using the same logic as other tracks.
 .IP
 At least for the time being, path names of scratches must be encoded using
 UTF-8 (which means that ASCII will do).
+.IP
+If \fBscratch\fR is used without arguments then the list of scratches is
+cleared.
 .TP
 .B stopword \fIWORD\fR ...
 Specifies one or more stopwords that should not take part in searches
 over track names.
+.IP
+If \fBstopword\fR is used without arguments then the list of stopwords is
+cleared.
 .TP
 .B tracklength \fIPATTERN\fR \fIMODULE\fR
 Specifies the module used to calculate the length of files matching
 \fIPATTERN\fR.  \fIMODULE\fR specifies which plugin module to use.
+.IP
+If \fBtracklength\fR is used without arguments then the list of modules is
+cleared.
 .SS "Client Configuration"
 .TP
 .B connect \fIHOST SERVICE\fR
@@ -468,6 +485,8 @@ interface.  If a template appears in more than one template directory
 then the one in the earliest directory specified is chosen.
 .IP
 See below for further details.
+.IP
+If \fBtemplates\fR is used without arguments then the template path is cleared.
 .TP
 .B transform \fITYPE\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
 Determines how names are sorted and displayed in track choice displays.
@@ -500,6 +519,10 @@ This must be the full URL, e.g. \fBhttp://myhost/cgi-bin/jukebox\fR and not
 .TP
 .B allow \fIUSERNAME\fR \fIPASSWORD\fR
 Specify a username/password pair.
+.IP
+If
+.B allow
+is used without arguments, the list of allowed users is cleared.
 .TP
 .B password \fIPASSWORD\fR
 Specify password.
@@ -507,6 +530,9 @@ Specify password.
 .B trust \fIUSERNAME\fR
 Allow \fIUSERNAME\fR to perform privileged operations such as shutting
 down or reconfiguring the daemon, or becoming another user.
+.IP
+If \fBtrust\fR is used without arguments then the list of trusted users is
+cleared.
 .TP
 .B user \fIUSER\fR
 Specifies the user to run as.  Only makes sense if invoked as root (or
@@ -739,7 +765,7 @@ Expands to the filename of the current file or directory, inside the template
 argument to \fBchoose\fR.
 .TP
 .B @files{\fITEMPLATE\fB}
-Expands \fITEMPLATE\fB once for each file indicated by the \fBdirectory\fR CGI
+Expands \fITEMPLATE\fR once for each file indicated by the \fBdirectory\fR CGI
 arg if it is present, or otherwise for the list of files counted by \fBfiles\fR
 with names \fB0_file\fR, \fB1_file\fR etc.
 .TP
@@ -984,7 +1010,7 @@ URL-quote \fISTRING\fR.
 Expands to \fBdisorder.cgi\fR's version string.
 .TP
 .B @volume:\fISPEAKER\fB@
-The volume on the left or right speaker.  \fISPEAKER\fR must be \fBleft\fB or
+The volume on the left or right speaker.  \fISPEAKER\fR must be \fBleft\fR or
 \fBright\fR.
 .TP
 .B @when@
index 221be9c44b80291f3ddde18663f088699f442ab1..d758751d3d061d1ac19aef263abcf67e865a0231 100644 (file)
@@ -226,6 +226,10 @@ static int set_stringlist_accum(const struct config_state *cs,
   struct stringlistlist *sll;
 
   sll = ADDRESS(cs->config, struct stringlistlist);
+  if(nvec == 0) {
+    sll->n = 0;
+    return 0;
+  }
   sll->n++;
   sll->s = xrealloc(sll->s, (sll->n * sizeof (struct stringlist)));
   s = &sll->s[sll->n - 1];
@@ -243,6 +247,10 @@ static int set_string_accum(const struct config_state *cs,
   struct stringlist *sl;
 
   sl = ADDRESS(cs->config, struct stringlist);
+  if(nvec == 0) {
+    sl->n = 0;
+    return 0;
+  }
   for(n = 0; n < nvec; ++n) {
     sl->n++;
     sl->s = xrealloc(sl->s, (sl->n * sizeof (char *)));
index 68a130d8b4b501c8f5ddf494e2ed64e1ab41a798..3936935b463d02ac4a606ade4154f99fd7b438b3 100644 (file)
@@ -167,7 +167,9 @@ stopword the a an and to too in on of we i am as im for is
 username fred
 password fredpass
 allow fred fredpass
+plugins
 plugins %s/plugins
+plugins %s/plugins/.libs
 player *.mp3 execraw disorder-decode
 player *.ogg execraw disorder-decode
 player *.wav execraw disorder-decode
@@ -176,7 +178,7 @@ tracklength *.mp3 disorder-tracklength
 tracklength *.ogg disorder-tracklength
 tracklength *.wav disorder-tracklength
 tracklength *.flac disorder-tracklength
-""" % (testroot, testroot, testroot, testroot, top_builddir))
+""" % (testroot, testroot, testroot, testroot, top_builddir, top_builddir))
     copyfile("%s/sounds/scratch.ogg" % top_srcdir,
              "%s/scratch.ogg" % testroot)