Re: PROPERTY output in Script API

Chapman Flack <[email protected]> Thu, 12 Oct 2017 11:19:22 -0400
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
On 06/15/2016 07:52 AM, Jean-Louis Martineau wrote:
> I added the following section in
> http://wiki.zmanda.com/index.php/Script_API
> 
>  Send property to the application
> 
> A pre-dle-amcheck script running on the client can set a property for
> the application 'selfcheck' command.
> 
> A pre-dle-estimate script running on the client can set a property for
> the application 'estimate' command.
> 
> A pre-dle-backup script running on the client can set a property for the
> application 'backup' command.
> 
> The script must print a line to stdout with the 'PROPERTY' keyword
> followed by the property name and property value
> 
>  eg. PROPERTY directory /new/path
> 
> And the application will get the '--directory=/new/path' argument.


Am I right about these additional details?

- The property value consists of all bytes succeeding the space
  after the property name, up to the newline, which is not included,
  or any NUL byte. A property value containing a newline or NUL
  cannot be represented.

- Scripts executed in a sequence (for example, multiple
  pre-dle-backup scripts executed in order by their 'priority'
  values) do not see properties set by earlier scripts in the
  sequence. The properties set by the scripts are simply accumulated
  to be sent to the application.

- A script can set a multiple-valued property by printing multiple
  PROPERTY lines with the same property name and one value each.

- The application will see all properties set by the sequence of
  scripts, in the order of execution of the scripts. If two or
  more scripts supply values for one property, the application
  will see them in order as a multiple-valued property.

This is what I think happens, from looking at the code; if correct,
it might be worth adding to the wiki.

-Chap