fn: sgnd_header_upsert_field
Purpose
Set an existing metadata field or insert it when absent.
Arguments
$1— Source path.$2— Section name.$3— Field name.$4— New field value.
Side effects
Rewrites the source header field; does not create a missing section.
Returns
- 0 on success; otherwise the status from set/add operations.
Usage
sgnd_header_upsert_field "$source_file" Metadata Version "2.2"
