Skip to content

Commit

Permalink
[backend] support buildtime in containerinfo/annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Apr 26, 2018
1 parent 54fcc5b commit 9b64cf5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/backend/BSRepServer/Containerinfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ sub containerinfo2obsbinlnk {
my $annotation = {};
$annotation->{'repo'} = $d->{'repos'} if $d->{'repos'};
$annotation->{'disturl'} = $d->{'disturl'} if $d->{'disturl'};
$annotation->{'buildtime'} = $d->{'buildtime'} if $d->{'buildtime'};
if (%$annotation) {
eval { $lnk->{'annotation'} = BSUtil::toxml($annotation, $BSXML::binannotation) };
warn($@) if $@;
Expand Down Expand Up @@ -118,6 +119,7 @@ sub readcontainerinfo {
my $file = $d->{'file'};
$d->{'file'} = $file = undef unless defined($file) && ref($file) eq '';
delete $d->{'disturl'} unless defined($d->{'disturl'}) && ref($d->{'disturl'}) eq '';
delete $d->{'buildtime'} unless defined($d->{'buildtime'}) && ref($d->{'buildtime'}) eq '';
return undef unless defined($name) && defined($file);
eval {
BSVerify::verify_simple($file);
Expand Down
1 change: 1 addition & 0 deletions src/backend/BSXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,7 @@ our $binannotation = [
'priority',
]],
'disturl',
'buildtime',
'package', # only in build job annotation
'epoch', # only in build job annotation
'version', # only in build job annotation
Expand Down
2 changes: 1 addition & 1 deletion src/backend/bs_worker
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,7 @@ sub getbinaries {
if ($buildinfo->{'containerannotation'}) {
my $annotation = BSUtil::fromxml($buildinfo->{'containerannotation'}, $BSXML::binannotation, 1);
if ($annotation) {
for (qw{package version release binaryarch disturl}) {
for (qw{package version release binaryarch disturl buildtime}) {
$bin->{$_} = $annotation->{$_} if defined($annotation->{$_}) && $annotation->{$_} ne '';
}
}
Expand Down

0 comments on commit 9b64cf5

Please sign in to comment.