!15 修复如下8 个issue

From: @wangmengc 
Reviewed-by: @ut-wanglujun 
Signed-off-by: @ut-wanglujun
This commit is contained in:
openeuler-ci-bot 2024-04-10 08:00:46 +00:00 committed by Gitee
commit 27977f51e5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 508 additions and 1 deletions

View File

@ -0,0 +1,67 @@
From d4b94557da630e74bf4128d82b5cc6942225456e Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Mon, 8 Apr 2024 15:02:35 +0800
Subject: [PATCH 1/8] =?UTF-8?q?fix=20utshell=20continue=20--help=20?=
=?UTF-8?q?=E5=92=8Ccountine=20=E5=AD=98=E5=9C=A8=E5=A4=9A=E4=BD=99?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
builtins_rust/break_1/src/lib.rs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/builtins_rust/break_1/src/lib.rs b/builtins_rust/break_1/src/lib.rs
index 9da3f71..d333247 100644
--- a/builtins_rust/break_1/src/lib.rs
+++ b/builtins_rust/break_1/src/lib.rs
@@ -13,7 +13,7 @@ use rcommon::{WordList, EXECUTION_FAILURE, EXECUTION_SUCCESS, EX_USAGE};
use rhelp::r_builtin_help;
type intmax_t = c_long;
-/*
+
#[macro_export]
macro_rules! ISHELP {
($s:expr) => {
@@ -25,12 +25,12 @@ macro_rules! ISHELP {
macro_rules! CHECK_HELPOPT {
($l:expr) => {
if $l !=std::ptr::null_mut() && (*$l).word !=std::ptr::null_mut() && ISHELP!((*(*$l).word).word) ==0 {
- builtin_help ();
+ r_builtin_help ();
return EX_USAGE;
}
}
}
-*/
+
fn checkhelp(l: *mut WordList) -> i32 {
unsafe {
let tmp = CString::new("--help").unwrap();
@@ -64,8 +64,8 @@ pub extern "C" fn r_break_builtin(list: *mut WordList) -> i32 {
//println!("enter r_break_builtin");
let mut newbreak: intmax_t = 1 as intmax_t;
unsafe {
- checkhelp(list);
- //CHECK_HELPOPT! (list);
+ //checkhelp(list);
+ CHECK_HELPOPT! (list);
if check_loop_level() == 0 {
return EXECUTION_SUCCESS!();
}
@@ -92,8 +92,8 @@ pub extern "C" fn r_break_builtin(list: *mut WordList) -> i32 {
pub extern "C" fn r_continue_builtin(list: *mut WordList) -> i32 {
let mut newcont: intmax_t = 0 as intmax_t;
unsafe {
- //CHECK_HELPOPT! (list);
- checkhelp(list);
+ CHECK_HELPOPT! (list);
+ //checkhelp(list);
}
if check_loop_level() == 0 {
return EXECUTION_SUCCESS!();
--
2.43.0

29
0002-fix-kill-l.patch Normal file
View File

@ -0,0 +1,29 @@
From 4a7427984d2937dfa99cb76ff2c4c07479079852 Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Mon, 8 Apr 2024 15:24:17 +0800
Subject: [PATCH 2/8] =?UTF-8?q?fix=20=20kill=20-l=E5=BA=8F=E5=8F=B7?=
=?UTF-8?q?=E6=9C=89=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
builtins_rust/common/src/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtins_rust/common/src/lib.rs b/builtins_rust/common/src/lib.rs
index 78566eb..1184461 100644
--- a/builtins_rust/common/src/lib.rs
+++ b/builtins_rust/common/src/lib.rs
@@ -1516,7 +1516,7 @@ pub extern "C" fn r_display_signal_list(mut list: *mut WordList, forcecols: i32)
}
} else {
print!(
- "{:02}{} {}",
+ "{:>2}{} {}",
i,
")",
CStr::from_ptr(name).to_str().unwrap().to_owned()
--
2.43.0

View File

@ -0,0 +1,24 @@
From 4b0f8a65e71da4ba05ac7850cd2f20fb11f1e174 Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Mon, 8 Apr 2024 15:31:41 +0800
Subject: [PATCH 4/8] fix exec -c exec -l Redundant output
---
builtins_rust/exec/src/lib.rs | 1 -
1 file changed, 1 deletion(-)
diff --git a/builtins_rust/exec/src/lib.rs b/builtins_rust/exec/src/lib.rs
index 4edefab..2e14b41 100644
--- a/builtins_rust/exec/src/lib.rs
+++ b/builtins_rust/exec/src/lib.rs
@@ -199,7 +199,6 @@ pub extern "C" fn r_exec_builtin(mut list: *mut WordList) -> i32 {
} else {
//exec后直接给命令
command = search_for_command(*args.offset(0), 1);
- println!("command:{}", CStr::from_ptr(command).to_str().unwrap());
}
if command.is_null() {
--
2.43.0

View File

@ -0,0 +1,99 @@
From f52a22e4cf9271cf0774ee652b37bd06a6a672f0 Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Mon, 8 Apr 2024 16:22:23 +0800
Subject: [PATCH 6/8] fix complete -p no display
---
configure | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/configure b/configure
index 285b377..57aca43 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac for Bash 5.1, version 5.022.
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for utshell 0.1-release.
+# Generated by GNU Autoconf 2.71 for utshell 5.1-release.
#
# Report bugs to <bug-utshell@gnu.org>.
#
@@ -612,8 +612,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='utshell'
PACKAGE_TARNAME='utshell'
-PACKAGE_VERSION='0.1-release'
-PACKAGE_STRING='utshell 0.1-release'
+PACKAGE_VERSION='5.1-release'
+PACKAGE_STRING='utshell 5.1-release'
PACKAGE_BUGREPORT='bug-utshell@gnu.org'
PACKAGE_URL=''
@@ -1461,7 +1461,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures utshell 0.1-release to adapt to many kinds of systems.
+\`configure' configures utshell 5.1-release to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1527,7 +1527,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of utshell 0.1-release:";;
+ short | recursive ) echo "Configuration of utshell 5.1-release:";;
esac
cat <<\_ACEOF
@@ -1729,7 +1729,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-utshell configure 0.1-release
+utshell configure 5.1-release
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2386,7 +2386,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by utshell $as_me 0.1-release, which was
+It was created by utshell $as_me 5.1-release, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -3164,7 +3164,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
-BASHVERS=0.1
+BASHVERS=5.1
RELSTATUS=release
case "$RELSTATUS" in
@@ -22732,7 +22732,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by utshell $as_me 0.1-release, which was
+This file was extended by utshell $as_me 5.1-release, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22800,7 +22800,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-utshell config.status 0.1-release
+utshell config.status 5.1-release
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
--
2.43.0

View File

@ -0,0 +1,272 @@
From 96968ffb832cf368d9ba13a420a2a516e076204c Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Tue, 9 Apr 2024 17:02:28 +0800
Subject: [PATCH] fix translation files correlation
---
resources/en-US/message.ftl | 46 +++++++++++++++++++----------------
resources/zh-CN/message.ftl | 48 +++++++++++++++++++------------------
resources/zh-HK/message.ftl | 47 ++++++++++++++++++------------------
3 files changed, 74 insertions(+), 67 deletions(-)
diff --git a/resources/en-US/message.ftl b/resources/en-US/message.ftl
index 8e6800c..26c2a3c 100644
--- a/resources/en-US/message.ftl
+++ b/resources/en-US/message.ftl
@@ -645,6 +645,9 @@ $cmdName ->
Arguments:
NAME Each NAME is searched for in $PATH and added to the list
of remembered commands.
+
+ Exit Status:
+ Returns success unless NAME is not found or an invalid option is given.
[help]
@@ -821,7 +824,7 @@ $cmdName ->
Exit Status:
Returns success unless job control is not enabled or an error occurs.
-[eval]
+[test]
Evaluate conditional expression.
Exits with a status of 0 (true) or 1 (false) depending on
@@ -902,6 +905,16 @@ $cmdName ->
Returns success if EXPR evaluates to true; fails if EXPR evaluates to
false or an invalid argument is given.
+[eval]
+ Execute arguments as a shell command.
+
+ Combine ARGs into a single string, use the result as input to the shell,
+ and execute the resulting commands.
+
+ Exit Status:
+ Returns exit status of command or success if command is null.
+
+
[times]
Display process times.
@@ -1398,26 +1411,17 @@ $cmdName ->
Returns success unless an invalid option is given or a NAME is read-only.
[local]
- Remember or display program locations.
-
- Determine and remember the full pathname of each command NAME. If
- no arguments are given, information about remembered commands is
- displayed.
-
- Options:
- -d forget the remembered location of each NAME
- -l display in a format that may be reused as input
- -p pathname use PATHNAME as the full pathname of NAME
- -r forget all remembered locations
- -t print the remembered location of each NAME, preceding
- each location with the corresponding NAME if multiple
- NAMEs are given
- Arguments:
- NAME Each NAME is searched for in $PATH and added to the list
- of remembered commands.
-
- Exit Status:
- Returns success unless NAME is not found or an invalid option is given.
+ Define local variables.
+
+ Create a local variable called NAME, and give it VALUE. OPTION can
+ be any option accepted by `declare'.
+
+ Local variables can only be used within a function; they are visible
+ only to the function where they are defined and its children.
+
+ Exit Status:
+ Returns success unless an invalid option is supplied, a variable
+ assignment error occurs, or the shell is not executing a function.
[export]
Set export attribute for shell variables.
diff --git a/resources/zh-CN/message.ftl b/resources/zh-CN/message.ftl
index 4cb92a5..aaff61e 100644
--- a/resources/zh-CN/message.ftl
+++ b/resources/zh-CN/message.ftl
@@ -249,6 +249,7 @@ $cmdName ->
信号名称大小写敏感且可以使用 SIG 前缀。信号可用 \kill -信号 $$\
发送给 shell。
+ 退出状态:
返回成功,除非使用了无效的选项或者 SIGSPEC。
[alias]
@@ -652,7 +653,7 @@ $cmdName ->
-s 以单条记录追加 ARG 到历史列表中
如果给定了 FILENAME 文件名,则它将被作为历史文件。否则
- 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.bash_history 文件。
+ 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.utshell_history 文件。
如果 $HISTTIMEFORMAT 变量被设定并且不为空,它的值会被用于
strftime(3) 的格式字符串来打印与每一个显示的历史条目想关联的
@@ -749,6 +750,9 @@ $cmdName ->
操作符按照优先级进行估值。括号中的子表达式将被先估值,并可取代上述表达式
规则。
+
+ 退出状态:
+ 如果最后一个 ARG 参数估值为 0则 let 返回 1 否则 let 返回 0。
[shift]
移位位置参数。
@@ -772,7 +776,7 @@ $cmdName ->
退出状态:
返回成功,除非没有启用任务控制或者有错误发生。
-[eval]
+[test]
对条件表达式进行估值。
根据 EXPR 表达式的估值以状态 0 (真) 或 1 (伪) 退出。
@@ -844,6 +848,15 @@ $cmdName ->
退出状态:
如果 EXPR 表达式估值为真则返回成功;如果 EXPR 表达式估值
为假或者使用了无效的参数则返回失败。
+
+[eval]
+ 将参数作为 shell 命令执行。
+
+ 将 ARGs 合成一个字符串,用结果作为 shell 的输入,
+ 并且执行得到的命令。
+
+ 退出状态:
+ 以命令的状态退出,或者在命令为空的情况下返回成功。
[times]
显示进程时间
@@ -1260,27 +1273,16 @@ $cmdName ->
返回成功,除非使用了无效的选项或者 NAME 名称为只读。
[local]
- 记住或显示程序位置。
-
- 确定并记住每一个给定 NAME 名称的命令的完整路径。
- 如果不提供参数,则显示已经记住的命令的信息。
-
- 选项:
- -d 忘记每一个已经记住的 NAME 的位置
- -l 以可作为输入重用的格式显示
- -p pathname 使用 pathname 路径作为 NAME 命令的全路径
- -r 忘记所有记住的位置
- -t 打印记住的每一个 NAME 名称的位置,如果指定了多个
- NAME 名称,则每个位置前面会加上相应的 NAME 名称
-
- 参数:
- NAME 每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命
- 令
- 列表中。
-
- 退出状态:
- 返回成功,除非 NAME 命令没有找到或者使用了无效的选项。
- 返回成功,除非使用了无效的选项或者 NAME 名称为只读。
+ 定义本地变量。
+
+ 创建一个以 NAME 为名称的变量,并且将 VALUE 赋值给它。
+ OPTION 选项可以是任何能被 `declare' 接受的选项。
+
+ 本地变量只能在函数内部被使用,它们只能在定义它们的函数内
+ 部以及子函数中可见。
+
+ 退出状态:
+ 返回成功,除非使用了无效的选项、发生了赋值错误或者 shell 不在执行一个函数。
[export]
为 shell 变量设定导出属性。
diff --git a/resources/zh-HK/message.ftl b/resources/zh-HK/message.ftl
index b668058..bf75e84 100644
--- a/resources/zh-HK/message.ftl
+++ b/resources/zh-HK/message.ftl
@@ -652,7 +652,7 @@ $cmdName ->
-s 以单条记录追加 ARG 到历史列表中
如果给定了 FILENAME 文件名,则它将被作为历史文件。否则
- 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.bash_history 文件。
+ 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.utshell_history 文件。
如果 $HISTTIMEFORMAT 变量被设定并且不为空,它的值会被用于
strftime(3) 的格式字符串来打印与每一个显示的历史条目想关联的
@@ -749,6 +749,9 @@ $cmdName ->
操作符按照优先级进行估值。括号中的子表达式将被先估值,并可取代上述表达式
规则。
+
+ 退出状态:
+ 如果最后一个 ARG 参数估值为 0则 let 返回 1 否则 let 返回 0。
[shift]
移位位置参数。
@@ -772,7 +775,7 @@ $cmdName ->
退出状态:
返回成功,除非没有启用任务控制或者有错误发生。
-[eval]
+[test]
对条件表达式进行估值。
根据 EXPR 表达式的估值以状态 0 (真) 或 1 (伪) 退出。
@@ -845,6 +848,15 @@ $cmdName ->
如果 EXPR 表达式估值为真则返回成功;如果 EXPR 表达式估值
为假或者使用了无效的参数则返回失败。
+[eval]
+ 将参数作为 shell 命令执行。
+
+ 将 ARGs 合成一个字符串,用结果作为 shell 的输入,
+ 并且执行得到的命令。
+
+ 退出状态:
+ 以命令的状态退出,或者在命令为空的情况下返回成功。
+
[times]
显示进程时间
@@ -1260,27 +1272,16 @@ $cmdName ->
返回成功,除非使用了无效的选项或者 NAME 名称为只读。
[local]
- 记住或显示程序位置。
-
- 确定并记住每一个给定 NAME 名称的命令的完整路径。
- 如果不提供参数,则显示已经记住的命令的信息。
-
- 选项:
- -d 忘记每一个已经记住的 NAME 的位置
- -l 以可作为输入重用的格式显示
- -p pathname 使用 pathname 路径作为 NAME 命令的全路径
- -r 忘记所有记住的位置
- -t 打印记住的每一个 NAME 名称的位置,如果指定了多个
- NAME 名称,则每个位置前面会加上相应的 NAME 名称
-
- 参数:
- NAME 每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命
- 令
- 列表中。
-
- 退出状态:
- 返回成功,除非 NAME 命令没有找到或者使用了无效的选项。
- 返回成功,除非使用了无效的选项或者 NAME 名称为只读。
+ 定義本機變數。
+
+ 建立一個以 <名稱> 為名稱的變數,並且將 VALUE 指派給它。
+ OPTION 選項可以是任何能被「declare」接受的選項。
+
+ 本機變數只能在函數內部被使用,它們只能在定義它們的函數內
+ 部以及子函數中可見。
+
+ 退出狀態:
+ 回傳成功,除非使用了無效的選項、發生了指派錯誤或者 shell 不在執行一個函數。
[export]
为 shell 变量设定导出属性。
--
2.43.0

View File

@ -6,12 +6,17 @@
Version: %{baseversion}%{patchleveltag}
Name: utshell
Summary: The utshell respect Bash
Release: 0%{?dist}
Release: 0%{?dist}.1
License: GPLv3+
Source0: utshell-%{baseversion}.tar.gz
# Official upstream patches
# Patches are converted to apply with '-p1'
Patch0001: 0001-fix-utshell-continue-help-countine.patch
Patch0002: 0002-fix-kill-l.patch
Patch0003: 0003-fix-exec-c-exec-l-Redundant-output.patch
Patch0004: 0004-fix-complete-p-no-display.patch
Patch0005: 0005-fix-translation-files-correlation.patch
# Other patches
# We don't want to add '/etc:/usr/etc' in standard utils path.
@ -129,6 +134,17 @@ end
%{_includedir}/%{name}
%changelog
* Tue Apr 09 2024 wangmeng<wangmengc@uniontech.com> - 0.5.0-0.1
- fix:I9CC1Z trap --help 与trap -l 缺少部分提示
- fix:I9CBXT help local中英文提示不符
- fix:I9CBPP hash --help中英文提示不一致
- fix:I9CBKZ exec -c exec -l存在多余输出
- fix:I9CBG7 let --help 提示不全
- fix:I9CAZZ ulimit -S命令不支持
- fix:I9CAS8 kill -l序号有误
- fix:I9CA9S continue --help 和countine 存在多余提示
- fix:I9CBRG complete -p无输出
* Mon Apr 01 2024 wangmeng<wangmengc@uniontech.com> - 0.5.0
- update to version 0.5