1 Star 0 Fork 110

HopeOS/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Don-t-unnecessarily-use-cat-and-use-grep-E.patch 911 Bytes
一键复制 编辑 原始数据 按行查看 历史
sun_hai 提交于 2024-06-29 17:25 +08:00 . sync from 24.03 LTS
From ab9b2f98134d99325ac468a7c01ed0e659464f3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= <oguz@ersen.moe>
Date: Sat, 26 Mar 2022 18:32:17 +0000
Subject: [PATCH] Don't unnecessarily use cat and use grep -E
---
scripts/anaconda-pre-log-gen | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/scripts/anaconda-pre-log-gen b/scripts/anaconda-pre-log-gen
index 30eacc8a3c..0012e076db 100755
--- a/scripts/anaconda-pre-log-gen
+++ b/scripts/anaconda-pre-log-gen
@@ -5,12 +5,8 @@
# where the resulting logs will be stored
TARGET_DIRECTORY=/tmp/pre-anaconda-logs
-BOOT_OPTIONS_FILE=/proc/cmdline
-
-DEBUG_ENABLED=`cat $BOOT_OPTIONS_FILE | egrep -c "\<debug\>|\<inst\.debug\>"`
-
# do not produce any logs unless debug is enabled
-[ $DEBUG_ENABLED == '0' ] && exit 0
+grep -E -q "\<debug\>|\<inst\.debug\>" /proc/cmdline || exit 0
mkdir ${TARGET_DIRECTORY}
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/HopeOS/anaconda.git
git@gitee.com:HopeOS/anaconda.git
HopeOS
anaconda
anaconda
master

搜索帮助