From 00558e8fa7194b17fdd218bb23ffeeb4ddd41be1 Mon Sep 17 00:00:00 2001 From: wangyaoyong Date: Thu, 23 May 2024 18:05:56 +0800 Subject: [PATCH 1/7] fix issue:I9KZET compile error on riscv64 --- 0007-fix-compile-error-on-riscv64.patch | 29 +++++++++++++++++++++++++ utshell.spec | 6 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0007-fix-compile-error-on-riscv64.patch diff --git a/0007-fix-compile-error-on-riscv64.patch b/0007-fix-compile-error-on-riscv64.patch new file mode 100644 index 0000000..7e65a7e --- /dev/null +++ b/0007-fix-compile-error-on-riscv64.patch @@ -0,0 +1,29 @@ +From b93998a221ad9e78540253016eadd634a39c1598 Mon Sep 17 00:00:00 2001 +From: wangyaoyong +Date: Thu, 23 May 2024 17:59:49 +0800 +Subject: [PATCH 1/1] fix compile error on riscv64 + +--- + Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 6affd14..0e8ff16 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -598,10 +598,10 @@ $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP) rust_builtins_lib rust + @echo " ***********************************************************" + @echo + +-rust_mainland_lib: ++rust_mainland_lib: $(SHLIB_LIBRARY) + @for it in $(RUST_MAINLAND_DIRS); do cd $$it ; cargo build; cd -; done + +-rust_builtins_lib: ++rust_builtins_lib: $(SHLIB_LIBRARY) + @for it in $(RUST_BUILTINS_DIRS); do cd $$it ; cargo build; cd -; done + + +-- +2.25.1 + diff --git a/utshell.spec b/utshell.spec index 293841e..bf5239b 100644 --- a/utshell.spec +++ b/utshell.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: utshell Summary: The utshell respect Bash -Release: 0%{?dist}.3 +Release: 0%{?dist}.4 License: GPLv3+ Source0: utshell-%{baseversion}.tar.gz @@ -18,6 +18,7 @@ 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 Patch0006: 0006-fix-select-error.patch +Patch0007: 0007-fix-compile-error-on-riscv64.patch # Other patches # We don't want to add '/etc:/usr/etc' in standard utils path. @@ -134,6 +135,9 @@ end %{_includedir}/%{name} %changelog +* Thu May 23 2024 wangyaoyong - 0.5.0-0.4 +- fix:I9KZET riscv64 下cargo build编译时出现缺少依赖的问题 + * Thu May 9 2024 wangmeng - 0.5.0-0.3 - fix:I9CANW select 关键字没有输出 -- Gitee From e20c6c3ef4ea7048629bac0a39c823304f884c28 Mon Sep 17 00:00:00 2001 From: wangmengc Date: Fri, 21 Jun 2024 17:06:35 +0800 Subject: [PATCH 2/7] #IA4DBK Change the version number to be consistent with other software packages --- utshell.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utshell.spec b/utshell.spec index bf5239b..afb1352 100644 --- a/utshell.spec +++ b/utshell.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: utshell Summary: The utshell respect Bash -Release: 0%{?dist}.4 +Release: 1%{?dist} License: GPLv3+ Source0: utshell-%{baseversion}.tar.gz @@ -135,6 +135,9 @@ end %{_includedir}/%{name} %changelog +* Fri Jun 21 2024 wangmeng - 0.5.1 +- fix:IA4DBK Change the verson number to be consistent with other software packages + * Thu May 23 2024 wangyaoyong - 0.5.0-0.4 - fix:I9KZET riscv64 下cargo build编译时出现缺少依赖的问题 -- Gitee From 8917d0c452d2d0b92b372cdeb6cfad9450debbb5 Mon Sep 17 00:00:00 2001 From: wangmengc Date: Fri, 13 Dec 2024 17:52:54 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9echo=E5=92=8Ctype?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0008-fix-echo-a.z.patch | 36 ++++++++++++++++++++++++++++++ 0009-fix-type-return-error.patch | 38 ++++++++++++++++++++++++++++++++ utshell.spec | 9 +++++++- 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 0008-fix-echo-a.z.patch create mode 100644 0009-fix-type-return-error.patch diff --git a/0008-fix-echo-a.z.patch b/0008-fix-echo-a.z.patch new file mode 100644 index 0000000..2c5471d --- /dev/null +++ b/0008-fix-echo-a.z.patch @@ -0,0 +1,36 @@ +From 35f29adb96c082cd94ec0c72c62556b4fde1e05c Mon Sep 17 00:00:00 2001 +From: wangmengc +Date: Fri, 13 Dec 2024 17:15:50 +0800 +Subject: [PATCH] fix echo {a..z} + +--- + r_braces/src/lib.rs | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/r_braces/src/lib.rs b/r_braces/src/lib.rs +index ee83ac1..d36ff1f 100644 +--- a/r_braces/src/lib.rs ++++ b/r_braces/src/lib.rs +@@ -378,7 +378,7 @@ pub unsafe extern "C" fn brace_expand( + loop { + if *amble.offset(j as isize) as libc::c_int == 0 as libc::c_int { + tack = expand_seqterm (amble, alen); +- if tack.is_null() { ++ if !tack.is_null() { + break; + } + else if !text.offset((i+1) as isize).is_null() { +@@ -692,7 +692,9 @@ unsafe extern "C" fn expand_seqterm( + lhs = substring(text, 0 as libc::c_int, lhs_l); + rhs = substring( + text, +- (lhs_l + std::mem::size_of::<[libc::c_char; 3]> as libc::c_int - 1 as libc::c_int ), ++ (lhs_l as libc::c_ulong) ++ .wrapping_add(::std::mem::size_of::<[libc::c_char; 3]>() as libc::c_ulong) ++ .wrapping_sub(1 as libc::c_int as libc::c_ulong) as libc::c_int, + tlen as libc::c_int, + ); + if *lhs.offset(0 as libc::c_int as isize) as libc::c_int == 0 as libc::c_int +-- +2.39.3 + diff --git a/0009-fix-type-return-error.patch b/0009-fix-type-return-error.patch new file mode 100644 index 0000000..c135976 --- /dev/null +++ b/0009-fix-type-return-error.patch @@ -0,0 +1,38 @@ +From 7af7b30f2dc162ff4999a5c0e11132796f62b0be Mon Sep 17 00:00:00 2001 +From: wangmengc +Date: Fri, 13 Dec 2024 17:35:33 +0800 +Subject: [PATCH] fix type return error + +--- + builtins_rust/type/src/lib.rs | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/builtins_rust/type/src/lib.rs b/builtins_rust/type/src/lib.rs +index 4940fae..c1b470e 100644 +--- a/builtins_rust/type/src/lib.rs ++++ b/builtins_rust/type/src/lib.rs +@@ -555,17 +555,16 @@ pub unsafe extern "C" fn r_type_builtin(mut list: *mut WordList) -> i32 { + sh_notfound((*(*list).word).word); + } + } +- any_failed = found + any_failed; +- let _ = any_failed == 0; +- // (any_failed += found) == 0; ++ ++ any_failed += (found == 0 as libc::c_int) as libc::c_int; + unsafe { + list = (*list).next; + } + } + if any_failed == 0 { +- EXECUTION_SUCCESS!(); ++ opt = EXECUTION_SUCCESS!(); + } else { +- EXECUTION_FAILURE!(); ++ opt = EXECUTION_FAILURE!(); + } + return unsafe { sh_chkwrite(opt) }; + } +-- +2.39.3 + diff --git a/utshell.spec b/utshell.spec index afb1352..54bdb30 100644 --- a/utshell.spec +++ b/utshell.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: utshell Summary: The utshell respect Bash -Release: 1%{?dist} +Release: 1%{?dist}.01 License: GPLv3+ Source0: utshell-%{baseversion}.tar.gz @@ -19,6 +19,8 @@ Patch0004: 0004-fix-complete-p-no-display.patch Patch0005: 0005-fix-translation-files-correlation.patch Patch0006: 0006-fix-select-error.patch Patch0007: 0007-fix-compile-error-on-riscv64.patch +Patch0008: 0008-fix-echo-a.z.patch +Patch0009: 0009-fix-type-return-error.patch # Other patches # We don't want to add '/etc:/usr/etc' in standard utils path. @@ -135,6 +137,11 @@ end %{_includedir}/%{name} %changelog +* Fri Dec 13 2024 wangmeng - 0.5.1-0.1 +- feat: add patch 0003-fix-echo-a.z.patch +- feat: add patch 0004-fix-type-return-error.patch +- 修复echo {a..z} 执行错误和type命令返回值错误 + * Fri Jun 21 2024 wangmeng - 0.5.1 - fix:IA4DBK Change the verson number to be consistent with other software packages -- Gitee From 2e727f843f2b620b1db07a9fe7ceae27b99211c0 Mon Sep 17 00:00:00 2001 From: wangmengc Date: Mon, 16 Dec 2024 11:07:50 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utshell.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utshell.spec b/utshell.spec index 54bdb30..b24d5ca 100644 --- a/utshell.spec +++ b/utshell.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: utshell Summary: The utshell respect Bash -Release: 1%{?dist}.01 +Release: 2%{?dist} License: GPLv3+ Source0: utshell-%{baseversion}.tar.gz -- Gitee From 7dccccf159c801bbcc65c76ea1e1e1d48a642eb1 Mon Sep 17 00:00:00 2001 From: wangmengc Date: Mon, 16 Dec 2024 13:11:00 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9changelog=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utshell.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utshell.spec b/utshell.spec index b24d5ca..c0eb77a 100644 --- a/utshell.spec +++ b/utshell.spec @@ -137,12 +137,12 @@ end %{_includedir}/%{name} %changelog -* Fri Dec 13 2024 wangmeng - 0.5.1-0.1 +* Fri Dec 13 2024 wangmeng - 0.5.0-2 - feat: add patch 0003-fix-echo-a.z.patch - feat: add patch 0004-fix-type-return-error.patch - 修复echo {a..z} 执行错误和type命令返回值错误 -* Fri Jun 21 2024 wangmeng - 0.5.1 +* Fri Jun 21 2024 wangmeng - 0.5.0-1 - fix:IA4DBK Change the verson number to be consistent with other software packages * Thu May 23 2024 wangyaoyong - 0.5.0-0.4 -- Gitee From a4a10f870a4cec34667a69bb087be2e301a09bb6 Mon Sep 17 00:00:00 2001 From: wangmengc Date: Mon, 16 Dec 2024 13:32:22 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9changelog=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utshell.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utshell.spec b/utshell.spec index c0eb77a..17041ff 100644 --- a/utshell.spec +++ b/utshell.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: utshell Summary: The utshell respect Bash -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Source0: utshell-%{baseversion}.tar.gz @@ -137,7 +137,7 @@ end %{_includedir}/%{name} %changelog -* Fri Dec 13 2024 wangmeng - 0.5.0-2 +* Fri Dec 13 2024 wangmeng - 0.5.0-3 - feat: add patch 0003-fix-echo-a.z.patch - feat: add patch 0004-fix-type-return-error.patch - 修复echo {a..z} 执行错误和type命令返回值错误 -- Gitee From 98c16ad2a4a13e311a9fe23bbb23864cf8372548 Mon Sep 17 00:00:00 2001 From: wangmengc Date: Thu, 13 Mar 2025 16:31:40 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcoproc=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=92=8Cutshell=20help=E6=98=BE=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0010-fix-coproc-command-error.patch | 34 +++++++++++++++++++++++++++++ 0011-fix-arch-display.patch | 34 +++++++++++++++++++++++++++++ utshell.spec | 8 ++++++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 0010-fix-coproc-command-error.patch create mode 100644 0011-fix-arch-display.patch diff --git a/0010-fix-coproc-command-error.patch b/0010-fix-coproc-command-error.patch new file mode 100644 index 0000000..c49d037 --- /dev/null +++ b/0010-fix-coproc-command-error.patch @@ -0,0 +1,34 @@ +From 963b01517eb7ff9823987643515d0818ad8e037c Mon Sep 17 00:00:00 2001 +From: wangmengc +Date: Thu, 13 Mar 2025 14:55:55 +0800 +Subject: [PATCH] fix coproc command error + +--- + r_print_cmd/src/lib.rs | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/r_print_cmd/src/lib.rs b/r_print_cmd/src/lib.rs +index fee41ed..ffdded9 100644 +--- a/r_print_cmd/src/lib.rs ++++ b/r_print_cmd/src/lib.rs +@@ -185,14 +185,14 @@ unsafe fn make_command_string_internal(command:*mut COMMAND) + indent(indentation); + } + +- if (*command).flags != 0 && CMD_TIME_PIPELINE != 0{ ++ if (*command).flags & CMD_TIME_PIPELINE as i32 != 0{ + cprintf(b"time \0" as *const u8 as *const c_char); +- if (*command).flags != 0 && CMD_TIME_POSIX != 0{ ++ if (*command).flags & CMD_TIME_POSIX as i32 != 0{ + cprintf(b"-p \0" as *const u8 as *const c_char); + } + } + +- if (*command).flags != 0 && CMD_INVERT_RETURN != 0{ ++ if (*command).flags & CMD_INVERT_RETURN as i32 != 0{ + cprintf(b"! \0" as *const u8 as *const c_char); + } + // (*command).type_ = 11; +-- +2.39.3 + diff --git a/0011-fix-arch-display.patch b/0011-fix-arch-display.patch new file mode 100644 index 0000000..5877385 --- /dev/null +++ b/0011-fix-arch-display.patch @@ -0,0 +1,34 @@ +From b4d841e78086b7b5c4aa42d7b7f49520a5ca4e8f Mon Sep 17 00:00:00 2001 +From: wangmengc +Date: Wed, 5 Mar 2025 11:29:45 +0800 +Subject: [PATCH] fix arch display + +--- + r_shell/src/lib.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/r_shell/src/lib.rs b/r_shell/src/lib.rs +index 38b6207..897302e 100644 +--- a/r_shell/src/lib.rs ++++ b/r_shell/src/lib.rs +@@ -14,7 +14,7 @@ extern "C" { + static mut rl_deprep_term_function: Option::; + static mut rl_readline_state: libc::c_ulong; + +- ++ fn get_mach_type() -> *mut libc::c_char; + fn getpwuid(__uid: __uid_t) -> *mut passwd; + fn endpwent(); + fn sh_setlinebuf(_: *mut FILE) -> libc::c_int; +@@ -1901,7 +1901,7 @@ unsafe extern "C" fn show_shell_usage(fp: *mut FILE, extra: libc::c_int) { + fp, + b"utshell, version %s-(%s)\n\0" as *const u8 as *const libc::c_char, + shell_version_string(), +- MACHTYPE!(), ++ get_mach_type(), + ); + } + fprintf( +-- +2.39.3 + diff --git a/utshell.spec b/utshell.spec index 17041ff..aa24a40 100644 --- a/utshell.spec +++ b/utshell.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: utshell Summary: The utshell respect Bash -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ Source0: utshell-%{baseversion}.tar.gz @@ -21,6 +21,8 @@ Patch0006: 0006-fix-select-error.patch Patch0007: 0007-fix-compile-error-on-riscv64.patch Patch0008: 0008-fix-echo-a.z.patch Patch0009: 0009-fix-type-return-error.patch +Patch0010: 0010-fix-coproc-command-error.patch +Patch0011: 0011-fix-arch-display.patch # Other patches # We don't want to add '/etc:/usr/etc' in standard utils path. @@ -137,6 +139,10 @@ end %{_includedir}/%{name} %changelog +* Wed Mar 5 2025 wangmeng - 0.5.0-4 +- feat: 修复coproc命令错误问题 +- feat: 修复utshell --help 显示信息问题 + * Fri Dec 13 2024 wangmeng - 0.5.0-3 - feat: add patch 0003-fix-echo-a.z.patch - feat: add patch 0004-fix-type-return-error.patch -- Gitee