fix: regex cpature NVR

Signed-off-by: Jia Chao <jiac13@chinaunicom.cn>
This commit is contained in:
Jia Chao 2024-07-25 09:55:42 +08:00
parent 6669e5b3b8
commit 4e40d33b25
26 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ {
"source": "csaf", "source": "csaf",
"target": "cusas" "target": "cusa"
} }

View File

@ -23,8 +23,11 @@ pub type Error = Box<dyn std::error::Error + Send + Sync>;
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;
lazy_static! { lazy_static! {
pub static ref NVR_RE: Regex = pub static ref NVR_RE: Regex = Regex::new(
Regex::new(r"^([a-zA-Z0-9\-_]+)-([0-9a-zA-Z\._]+)-([0-9a-zA-Z\._]+)").unwrap(); // %{name}-%{version}-%{release}.[oexxxx.xxx.rpm]
r"^([a-zA-Z0-9\-_+]+)-([0-9a-zA-Z\._+]+)-([0-9a-zA-Z\._-]+).(oe[0-9a-z]+.[0-9a-z]+.rpm)"
)
.unwrap();
} }
pub fn cumain() -> Result<()> { pub fn cumain() -> Result<()> {