From 4e40d33b25ec6131b402f8d6e0f3e00fba8bcf4f Mon Sep 17 00:00:00 2001 From: Jia Chao Date: Thu, 25 Jul 2024 09:55:42 +0800 Subject: [PATCH] fix: regex cpature NVR Signed-off-by: Jia Chao --- csaf2cusa.json | 2 +- {cusas => cusa}/O/openjpeg2/config.json | 0 {cusas => cusa}/O/openssh/config.json | 0 {cusas => cusa}/O/openssl/config.json | 0 {cusas => cusa}/O/openvpn/config.json | 0 {cusas => cusa}/a/arm-trusted-firmware/config.json | 0 {cusas => cusa}/c/cockpit/config.json | 0 {cusas => cusa}/e/emacs/config.json | 0 {cusas => cusa}/e/exiv2/config.json | 0 {cusas => cusa}/f/ffmpeg/config.json | 0 {cusas => cusa}/f/firefox/config.json | 0 {cusas => cusa}/f/freeradius/config.json | 0 {cusas => cusa}/g/glibc/config.json | 0 {cusas => cusa}/h/httpd/config.json | 0 {cusas => cusa}/k/kernel/config.json | 0 {cusas => cusa}/k/krb5/config.json | 0 {cusas => cusa}/m/mod_http2/config.json | 0 {cusas => cusa}/m/mongo-c-driver/config.json | 0 {cusas => cusa}/p/python-pip/config.json | 0 {cusas => cusa}/q/qemu/config.json | 0 {cusas => cusa}/r/rapidjson/config.json | 0 {cusas => cusa}/r/ruby/config.json | 0 {cusas => cusa}/r/rubygem-rack/config.json | 0 {cusas => cusa}/v/vte291/config.json | 0 {cusas => cusa}/x/xorg-x11-server-xwayland/config.json | 0 src/lib.rs | 7 +++++-- 26 files changed, 6 insertions(+), 3 deletions(-) rename {cusas => cusa}/O/openjpeg2/config.json (100%) rename {cusas => cusa}/O/openssh/config.json (100%) rename {cusas => cusa}/O/openssl/config.json (100%) rename {cusas => cusa}/O/openvpn/config.json (100%) rename {cusas => cusa}/a/arm-trusted-firmware/config.json (100%) rename {cusas => cusa}/c/cockpit/config.json (100%) rename {cusas => cusa}/e/emacs/config.json (100%) rename {cusas => cusa}/e/exiv2/config.json (100%) rename {cusas => cusa}/f/ffmpeg/config.json (100%) rename {cusas => cusa}/f/firefox/config.json (100%) rename {cusas => cusa}/f/freeradius/config.json (100%) rename {cusas => cusa}/g/glibc/config.json (100%) rename {cusas => cusa}/h/httpd/config.json (100%) rename {cusas => cusa}/k/kernel/config.json (100%) rename {cusas => cusa}/k/krb5/config.json (100%) rename {cusas => cusa}/m/mod_http2/config.json (100%) rename {cusas => cusa}/m/mongo-c-driver/config.json (100%) rename {cusas => cusa}/p/python-pip/config.json (100%) rename {cusas => cusa}/q/qemu/config.json (100%) rename {cusas => cusa}/r/rapidjson/config.json (100%) rename {cusas => cusa}/r/ruby/config.json (100%) rename {cusas => cusa}/r/rubygem-rack/config.json (100%) rename {cusas => cusa}/v/vte291/config.json (100%) rename {cusas => cusa}/x/xorg-x11-server-xwayland/config.json (100%) diff --git a/csaf2cusa.json b/csaf2cusa.json index 2a1ba60..1a407d8 100644 --- a/csaf2cusa.json +++ b/csaf2cusa.json @@ -1,4 +1,4 @@ { "source": "csaf", - "target": "cusas" + "target": "cusa" } diff --git a/cusas/O/openjpeg2/config.json b/cusa/O/openjpeg2/config.json similarity index 100% rename from cusas/O/openjpeg2/config.json rename to cusa/O/openjpeg2/config.json diff --git a/cusas/O/openssh/config.json b/cusa/O/openssh/config.json similarity index 100% rename from cusas/O/openssh/config.json rename to cusa/O/openssh/config.json diff --git a/cusas/O/openssl/config.json b/cusa/O/openssl/config.json similarity index 100% rename from cusas/O/openssl/config.json rename to cusa/O/openssl/config.json diff --git a/cusas/O/openvpn/config.json b/cusa/O/openvpn/config.json similarity index 100% rename from cusas/O/openvpn/config.json rename to cusa/O/openvpn/config.json diff --git a/cusas/a/arm-trusted-firmware/config.json b/cusa/a/arm-trusted-firmware/config.json similarity index 100% rename from cusas/a/arm-trusted-firmware/config.json rename to cusa/a/arm-trusted-firmware/config.json diff --git a/cusas/c/cockpit/config.json b/cusa/c/cockpit/config.json similarity index 100% rename from cusas/c/cockpit/config.json rename to cusa/c/cockpit/config.json diff --git a/cusas/e/emacs/config.json b/cusa/e/emacs/config.json similarity index 100% rename from cusas/e/emacs/config.json rename to cusa/e/emacs/config.json diff --git a/cusas/e/exiv2/config.json b/cusa/e/exiv2/config.json similarity index 100% rename from cusas/e/exiv2/config.json rename to cusa/e/exiv2/config.json diff --git a/cusas/f/ffmpeg/config.json b/cusa/f/ffmpeg/config.json similarity index 100% rename from cusas/f/ffmpeg/config.json rename to cusa/f/ffmpeg/config.json diff --git a/cusas/f/firefox/config.json b/cusa/f/firefox/config.json similarity index 100% rename from cusas/f/firefox/config.json rename to cusa/f/firefox/config.json diff --git a/cusas/f/freeradius/config.json b/cusa/f/freeradius/config.json similarity index 100% rename from cusas/f/freeradius/config.json rename to cusa/f/freeradius/config.json diff --git a/cusas/g/glibc/config.json b/cusa/g/glibc/config.json similarity index 100% rename from cusas/g/glibc/config.json rename to cusa/g/glibc/config.json diff --git a/cusas/h/httpd/config.json b/cusa/h/httpd/config.json similarity index 100% rename from cusas/h/httpd/config.json rename to cusa/h/httpd/config.json diff --git a/cusas/k/kernel/config.json b/cusa/k/kernel/config.json similarity index 100% rename from cusas/k/kernel/config.json rename to cusa/k/kernel/config.json diff --git a/cusas/k/krb5/config.json b/cusa/k/krb5/config.json similarity index 100% rename from cusas/k/krb5/config.json rename to cusa/k/krb5/config.json diff --git a/cusas/m/mod_http2/config.json b/cusa/m/mod_http2/config.json similarity index 100% rename from cusas/m/mod_http2/config.json rename to cusa/m/mod_http2/config.json diff --git a/cusas/m/mongo-c-driver/config.json b/cusa/m/mongo-c-driver/config.json similarity index 100% rename from cusas/m/mongo-c-driver/config.json rename to cusa/m/mongo-c-driver/config.json diff --git a/cusas/p/python-pip/config.json b/cusa/p/python-pip/config.json similarity index 100% rename from cusas/p/python-pip/config.json rename to cusa/p/python-pip/config.json diff --git a/cusas/q/qemu/config.json b/cusa/q/qemu/config.json similarity index 100% rename from cusas/q/qemu/config.json rename to cusa/q/qemu/config.json diff --git a/cusas/r/rapidjson/config.json b/cusa/r/rapidjson/config.json similarity index 100% rename from cusas/r/rapidjson/config.json rename to cusa/r/rapidjson/config.json diff --git a/cusas/r/ruby/config.json b/cusa/r/ruby/config.json similarity index 100% rename from cusas/r/ruby/config.json rename to cusa/r/ruby/config.json diff --git a/cusas/r/rubygem-rack/config.json b/cusa/r/rubygem-rack/config.json similarity index 100% rename from cusas/r/rubygem-rack/config.json rename to cusa/r/rubygem-rack/config.json diff --git a/cusas/v/vte291/config.json b/cusa/v/vte291/config.json similarity index 100% rename from cusas/v/vte291/config.json rename to cusa/v/vte291/config.json diff --git a/cusas/x/xorg-x11-server-xwayland/config.json b/cusa/x/xorg-x11-server-xwayland/config.json similarity index 100% rename from cusas/x/xorg-x11-server-xwayland/config.json rename to cusa/x/xorg-x11-server-xwayland/config.json diff --git a/src/lib.rs b/src/lib.rs index 4f9ef0c..a781e3e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,8 +23,11 @@ pub type Error = Box; pub type Result = std::result::Result; lazy_static! { - pub static ref NVR_RE: Regex = - Regex::new(r"^([a-zA-Z0-9\-_]+)-([0-9a-zA-Z\._]+)-([0-9a-zA-Z\._]+)").unwrap(); + pub static ref NVR_RE: Regex = Regex::new( + // %{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<()> {