From f7017a9eacd405da335839b5622f1ca915d0d3ce Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Mon, 2 May 2022 10:39:42 +0200 Subject: [PATCH] Fix NVR regex for versions with a percentage, and fix dist regex for any EL --- pkg/rpmutils/regex.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rpmutils/regex.go b/pkg/rpmutils/regex.go index b3094fe..90c59fb 100644 --- a/pkg/rpmutils/regex.go +++ b/pkg/rpmutils/regex.go @@ -3,9 +3,9 @@ package rpmutils import "regexp" var ( - Nvr = regexp.MustCompile("^(\\S+)-([\\w.]+)-(\\w+(?:\\.[\\w+]+)+?)(?:\\.(\\w+))?(?:\\.rpm)?$") + Nvr = regexp.MustCompile("^(\\S+)-([\\w~%.]+)-(\\w+(?:\\.[\\w+]+)+?)(?:\\.(\\w+))?(?:\\.rpm)?$") epoch = regexp.MustCompile("(\\d+):") module = regexp.MustCompile("^(.+)-(.+)-([0-9]{19})\\.((?:.+){8})$") - dist = regexp.MustCompile("(\\.el8(?:(?:_\\d)|))") + dist = regexp.MustCompile("(\\.el\\d(?:_\\d|))") moduleDist = regexp.MustCompile("\\.module.+$") )