{% if comm['output_files'] %}

    #Annotate output file(s)
    {% set anno = c.annotate %}

    echo "${txtcyn}Annotate:${bldblk}"
    {% for fld in anno -%}
    echo "- ${txtgrn}{{ fld }}${bldblk} '{{ anno.get(fld) }}'${txtrst}"
    {% endfor %}
    {%- for i in input_files -%}
    echo "- ${txtgrn}derivedFrom${bldblk} '{{ i['fullpath'] }}'${txtrst}"
    {%- if i.has_key('hash.sha1') %}
    echo "- ${txtgrn}derivedFromSha1${bldblk} '{{ i['hash.sha1'] }}'${txtrst}"
    {% endif %}

    {% endfor %}

    # generate a sha1 for the target file
    {%-  for toannot in comm['output_files'] %}
    if [[ -e "{{ toannot }}" ]]; then
        echo "${txtgrn}Generate sha1${bldblk} '{{ toannot }}'${txtrst}"
        mad sha1 {{ toannot }}
    fi
    {%- endfor %}

    mad mset
    {%- for fld in anno -%}
      {{ ' ' }} -k "{{fld}}" "{{ anno.get(fld) }}"
    {%- endfor -%}{{ ' ' }}{%- for i in input_files -%}
      {{ ' ' }} -k "derivedFrom" "{{ i['fullpath'] }}"
    {%- if i.has_key('hash.sha1') -%}
      {{ ' ' }} -k "derivedFromSha1" "{{ i['hash.sha1'] }}"
    {%- endif -%}{%- endfor -%}{{ ' ' }}
    {%- for toannot in comm.output_files -%}
        {{ toannot  }} {{ ' ' }}
    {%- endfor %}
{% endif -%}
