container sync: try and handle different filenames with Kiwi
Kiwi doesn't just result in different Koji NVRs for container
images, but the actual filenames differ too.
This problem really shows the limits of the current approach to
this; this script should really be fed the compose metadata and
use that to find images, and it should probably be a toddler,
and it should be in a real language, not shell. Fixing this in
shell script with the current 'poke the Koji task' approach is
somewhat painful and I'm not super confident this is 100% correct
(I will test it when I'm home on a regular internet connection),
but I wanted to get something done at least before diving into a
complete rewrite.
The reference jobs I tried to test this against are:
https://koji.fedoraproject.org/koji/buildinfo?buildID=2421063
https://koji.fedoraproject.org/koji/buildinfo?buildID=2421062
https://koji.fedoraproject.org/koji/buildinfo?buildID=2421079
From those, it looks like the filename format for Kiwi is more
or less (name).(arch)-(version)-(release).oci.tar.xz, and that's
what we try to use here, for releases higher than 39, keeping
the old (name)-(version)-(release).(arch).tar.xz format for older
releases. This is much more awkward in shell script than it would
be in a real language.
Signed-off-by: Adam Williamson <awilliam@redhat.com>