diff options
author | Michael Schroeder <mls@suse.de> | 2010-03-03 12:39:00 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2010-03-03 12:39:00 +0100 |
commit | 0929a90d18c61de4b05e039e3da157774dc9b4f1 (patch) | |
tree | 1233da6482eb02b27e310b6fc35b098cbd3d0b6a | |
parent | 77ab9fa16c0101d76be47d613662c072929d41ef (diff) | |
download | obs-build-0929a90d18c61de4b05e039e3da157774dc9b4f1.tar.gz obs-build-0929a90d18c61de4b05e039e3da157774dc9b4f1.tar.bz2 obs-build-0929a90d18c61de4b05e039e3da157774dc9b4f1.zip |
- add method to query leadsigid
-rw-r--r-- | Build.pm | 10 | ||||
-rw-r--r-- | Build/Rpm.pm | 5 |
2 files changed, 9 insertions, 6 deletions
@@ -776,11 +776,11 @@ sub query { sub queryhdrmd5 { my ($binname) = @_; - return Build::Rpm::queryhdrmd5($binname) if $do_rpm && $binname =~ /\.rpm$/; - return Build::Deb::queryhdrmd5($binname) if $do_deb && $binname =~ /\.deb$/; - return Build::Kiwi::queryhdrmd5($binname) if $do_kiwi && $binname =~ /\.iso$/; - return Build::Kiwi::queryhdrmd5($binname) if $do_kiwi && $binname =~ /\.raw$/; - return Build::Kiwi::queryhdrmd5($binname) if $do_kiwi && $binname =~ /\.raw.install$/; + return Build::Rpm::queryhdrmd5(@_) if $do_rpm && $binname =~ /\.rpm$/; + return Build::Deb::queryhdrmd5(@_) if $do_deb && $binname =~ /\.deb$/; + return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.iso$/; + return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw$/; + return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw.install$/; return undef; } diff --git a/Build/Rpm.pm b/Build/Rpm.pm index 5d63d99..a0bebd1 100644 --- a/Build/Rpm.pm +++ b/Build/Rpm.pm @@ -2,6 +2,8 @@ package Build::Rpm; use strict; +use Digest::MD5; + sub expr { my $expr = shift; my $lev = shift; @@ -763,7 +765,7 @@ sub query { } sub queryhdrmd5 { - my ($bin) = @_; + my ($bin, $leadsigp) = @_; local *F; open(F, '<', $bin) || die("$bin: $!\n"); @@ -800,6 +802,7 @@ sub queryhdrmd5 { } } close F; + $$leadsigp = Digest::MD5::md5_hex(substr($buf, 0, $hlen)) if $leadsigp; my $idxarea = substr($buf, 96 + 16, $cnt * 16); if ($idxarea !~ /\A(?:.{16})*\000\000\003\354\000\000\000\007(....)\000\000\000\020/s) { warn("$bin: no md5 signature header\n"); |