Skip to content

Commit

Permalink
🐛 Assign epoch in RPM static package manager. (#4255)
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <[email protected]>
  • Loading branch information
preslavgerchev authored Jun 18, 2024
1 parent a87d381 commit e6e68e3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions providers/os/resources/packages/rpm_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ package packages
import (
"bufio"
"fmt"
"github.com/package-url/packageurl-go"
"go.mondoo.com/cnquery/v11/providers/os/resources/cpe"
"go.mondoo.com/cnquery/v11/providers/os/resources/purl"
"io"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"

"github.com/package-url/packageurl-go"
"go.mondoo.com/cnquery/v11/providers/os/resources/cpe"
"go.mondoo.com/cnquery/v11/providers/os/resources/purl"

"github.com/cockroachdb/errors"
_ "github.com/glebarez/go-sqlite" // required for sqlite3 rpm support
rpmdb "github.com/knqyf263/go-rpmdb/pkg"
Expand Down Expand Up @@ -258,11 +259,13 @@ func (rpm *RpmPkgManager) staticList() ([]Package, error) {
resultList := []Package{}
for _, pkg := range pkgList {
version := pkg.Version
epoch := strconv.Itoa(pkg.EpochNum())
version = epoch + ":" + version
if pkg.Release != "" {
version = version + "-" + pkg.Release
}

rpmPkg := newRpmPackage(rpm.platform, pkg.Name, version, pkg.Arch, strconv.Itoa(pkg.EpochNum()), pkg.Summary)
rpmPkg := newRpmPackage(rpm.platform, pkg.Name, version, pkg.Arch, epoch, pkg.Summary)

// determine all files attached
records := []FileRecord{}
Expand Down

0 comments on commit e6e68e3

Please sign in to comment.