diff options
author | Michael Schroeder <mls@suse.de> | 2014-06-27 16:18:57 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-06-27 16:19:27 +0200 |
commit | ec3e746e00cba04196d14c38a22e6632c1e94f74 (patch) | |
tree | 47cc213eab8ffbf75f549dc6c8b2e1dc8d4d103d /Build | |
parent | 29c55104c2165b28f69d7395bae38a3fa385de56 (diff) |
add a way to query the buildtime and the disturl
Diffstat (limited to 'Build')
-rw-r--r-- | Build/Arch.pm | 1 | ||||
-rw-r--r-- | Build/Rpm.pm | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Build/Arch.pm b/Build/Arch.pm index 17680be..9d4f727 100644 --- a/Build/Arch.pm +++ b/Build/Arch.pm @@ -174,6 +174,7 @@ sub query { # arch packages don't seem to have a source :( # fake it so that the package isn't confused with a src package $ret->{'source'} = $ret->{'name'} if defined $ret->{'name'}; + $ret->{'buildtime'} = $vars->{'builddate'}->[0] if $opts{'buildtime'} && $vars->{'builddate'}; return $ret; } diff --git a/Build/Rpm.pm b/Build/Rpm.pm index e6a1815..542ff5e 100644 --- a/Build/Rpm.pm +++ b/Build/Rpm.pm @@ -565,6 +565,7 @@ my %rpmstag = ( "EPOCH" => 1003, "SUMMARY" => 1004, "DESCRIPTION" => 1005, + "BUILDTIME" => 1006, "ARCH" => 1022, "OLDFILENAMES" => 1027, "SOURCERPM" => 1044, @@ -580,6 +581,7 @@ my %rpmstag = ( "DIRINDEXES" => 1116, "BASENAMES" => 1117, "DIRNAMES" => 1118, + "DISTURL" => 1123, ); sub rpmq { @@ -842,6 +844,8 @@ sub query { push @tags, qw{EPOCH VERSION RELEASE ARCH}; push @tags, qw{FILENAMES} if $opts{'filelist'}; push @tags, qw{SUMMARY DESCRIPTION} if $opts{'description'}; + push @tags, qw{DISTURL} if $opts{'disturl'}; + push @tags, qw{BUILDTIME} if $opts{'buildtime'}; my %res = rpmq($handle, @tags); return undef unless %res; my $src = $res{'SOURCERPM'}->[0]; @@ -894,6 +898,8 @@ sub query { $data->{'summary'} = $res{'SUMMARY'}->[0]; $data->{'description'} = $res{'DESCRIPTION'}->[0]; } + $data->{'buildtime'} = $res{'BUILDTIME'}->[0] if $opts{'buildtime'}; + $data->{'disturl'} = $res{'DISTURL'}->[0] if $opts{'disturl'} && $res{'DISTURL'}; return $data; } |