From 90bab54b6648407577082c6baf80e766a6ad8c61 Mon Sep 17 00:00:00 2001
From: chenjiayi <chenjiayi22@huawei.com>
Date: Wed, 17 Apr 2024 18:41:39 +0800
Subject: [PATCH 2/3] fix(devmaster): fix incorrect cmdline parameter value due
 to previous refactor

Previous 87234aafd1ab7a82588e45b8d104bda2d708ef90 changed the procedure on how to
get a cmdline parameter. The logic in devmaster was not modified synchronously.
---
 exts/devmaster/src/lib/rules/exec_mgr.rs | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/exts/devmaster/src/lib/rules/exec_mgr.rs b/exts/devmaster/src/lib/rules/exec_mgr.rs
index 22b9a2ad..54e0093e 100644
--- a/exts/devmaster/src/lib/rules/exec_mgr.rs
+++ b/exts/devmaster/src/lib/rules/exec_mgr.rs
@@ -903,20 +903,16 @@ impl ExecuteManager {
             }
             MatchImportCmdline => {
                 let cmdline = basic::cmdline::Cmdline::default();
-                let s = cmdline.get_param(&token_value);
 
-                if s.is_none() {
+                if !cmdline.has_param(&token_value) {
                     return Ok(token.read().unwrap().as_ref().unwrap().op == OperatorType::Nomatch);
                 }
 
-                let value = match s.as_ref().unwrap().split_once('=') {
-                    Some(ret) => ret.1,
-                    None => "",
-                };
+                let value = cmdline.get_param(&token_value);
 
                 execute_err!(
                     token.read().unwrap().as_ref().unwrap(),
-                    device.add_property(&token_value, if value.is_empty() { "1" } else { value })
+                    device.add_property(&token_value, &value.unwrap_or_default())
                 )?;
 
                 Ok(token.read().unwrap().as_ref().unwrap().op == OperatorType::Match)
-- 
2.33.0

