1
0
forked from ALHP/ALHP.GO

added safeguard against version missing

This commit is contained in:
2022-08-14 21:40:42 +02:00
parent e21f47f93b
commit ba8d02927f

View File

@@ -150,6 +150,17 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) {
workerId := uuid.New() workerId := uuid.New()
chroot := "build_" + workerId.String() chroot := "build_" + workerId.String()
if p.Version == "" {
if p.Srcinfo == nil {
err := p.genSrcinfo()
if err != nil {
return time.Since(start), fmt.Errorf("error generating srcinfo: %w", err)
}
}
p.Version = constructVersion(p.Srcinfo.Pkgver, p.Srcinfo.Pkgrel, p.Srcinfo.Epoch)
}
log.Infof("[%s/%s/%s] Build starting", p.FullRepo, p.Pkgbase, p.Version) log.Infof("[%s/%s/%s] Build starting", p.FullRepo, p.Pkgbase, p.Version)
p.toDbPackage(true) p.toDbPackage(true)