diff --git a/impl/create_srpm.go b/impl/create_srpm.go index 80b6e2b..6485909 100644 --- a/impl/create_srpm.go +++ b/impl/create_srpm.go @@ -192,6 +192,13 @@ func (bldr *srpmBuilder) verifyUpstreamSrpm() error { bldr.errPrefix) } + // Check if downloaded file is a valid rpm + err := util.RunSystemCmd("rpm", "-q", "-p", upstreamSrpmFilePath) + if err != nil { + return fmt.Errorf("%sDownloaded SRPM file is not a valid rpm: %s", + bldr.errPrefix, err) + } + if !upstreamSrc.skipSigCheck { if err := util.VerifyRpmSignature(upstreamSrpmFilePath, bldr.errPrefix); err != nil { return err