- my @file_list = @{$image->{files}};
- if ((scalar(@file_list) == 1) &&
- ($file_list[0][1] =~ /^([0-9A-Fa-f]{64})\.tar$/)) {
- return ($file_list[0][0], $1);
+ foreach my $line (split(/\n/, $image->{manifest_text})) {
+ my @tokens = split(/\s+/, $line);
+ next if (!@tokens);
+ $streamname = shift(@tokens);
+ foreach my $filedata (grep(/^\d+:\d+:/, @tokens)) {
+ if (defined($filename)) {
+ return (undef, undef); # More than one file in the Collection.
+ } else {
+ $filename = (split(/:/, $filedata, 3))[2];
+ }
+ }