re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-07-20 15:48:34 +02:00
parent ca278b5f21
commit 6923d91bb7
8 changed files with 226 additions and 1 deletions

5
.gitignore vendored
View File

@ -1,2 +1,5 @@
SOURCES/bash-4.4.tar.gz bash-4.1.tar.gz
/bash-4.2-rc2.tar.gz
/bash-4.2.tar.gz
/bash-4.3.tar.gz
/bash-4.4.tar.gz /bash-4.4.tar.gz

16
STAGE1-bash Normal file
View File

@ -0,0 +1,16 @@
srpm bash
mcd $BUILDDIR/bash
cat <<EOF > config.cache
bash_cv_func_ctype_nonascii=yes
bash_cv_opendir_not_robust=no
bash_cv_ulimit_maxfds=yes
bash_cv_func_sigsetjmp=present
bash_cv_printf_a_format=yes
bash_cv_job_control_missing=present
bash_cv_sys_named_pipes=present
bash_cv_unusable_rtsigs=no
EOF
$SRC/bash-*/configure --prefix=/ --cache-file=config.cache --build=$BUILD --host=$TARGET
make $J
make $J install DESTDIR=${ROOTFS}
(cd $ROOTFS/bin; ln -sf bash sh)

60
bash-4.2-trap.patch Normal file
View File

@ -0,0 +1,60 @@
commit 41d203e21f94c1b8bfc457606ee633c22da3cf04
Author: Chet Ramey <chet.ramey@case.edu>
Date: Wed Jun 12 09:29:51 2013 -0400
commit bash-20130523 snapshot
diff --git a/trap.c b/trap.c
index 1e11d1f..da59b26 100644
--- a/trap.c
+++ b/trap.c
@@ -286,6 +286,9 @@ run_pending_traps ()
if (catch_flag == 0) /* simple optimization */
return;
+ if (running_trap > 0)
+ return; /* no recursive trap invocations */
+
catch_flag = trapped_signal_received = 0;
/* Preserve $? when running trap. */
@@ -304,6 +307,8 @@ run_pending_traps ()
BLOCK_SIGNAL (sig, set, oset);
+ running_trap = sig + 1;
+
if (sig == SIGINT)
{
run_interrupt_trap ();
@@ -324,6 +329,7 @@ run_pending_traps ()
{
/* This can happen when run_pending_traps is called while
running a SIGCHLD trap handler. */
+ running_trap = 0;
UNBLOCK_SIGNAL (oset);
continue; /* XXX */
}
@@ -359,7 +365,14 @@ run_pending_traps ()
save_subst_varlist = subst_assign_varlist;
subst_assign_varlist = 0;
+#if defined (JOB_CONTROL)
+ save_pipeline (1); /* XXX only provides one save level */
+#endif
evalstring (savestring (trap_list[sig]), "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE);
+#if defined (JOB_CONTROL)
+ restore_pipeline (1);
+#endif
+
restore_token_state (token_state);
free (token_state);
@@ -367,6 +380,7 @@ run_pending_traps ()
}
pending_traps[sig] = 0;
+ running_trap = 0;
UNBLOCK_SIGNAL (oset);
}

View File

@ -0,0 +1,47 @@
*** ../bash-4.3-patched/shell.h 2012-12-25 21:11:01.000000000 -0500
--- shell.h 2014-06-03 09:24:28.000000000 -0400
***************
*** 169,173 ****
int expand_aliases;
int echo_input_at_read;
!
} sh_parser_state_t;
--- 169,174 ----
int expand_aliases;
int echo_input_at_read;
! int need_here_doc;
!
} sh_parser_state_t;
*** ../bash-4.3-patched/parse.y 2014-05-14 09:16:40.000000000 -0400
--- parse.y 2014-04-30 09:27:59.000000000 -0400
***************
*** 2643,2647 ****
r = 0;
! while (need_here_doc)
{
parser_state |= PST_HEREDOC;
--- 2643,2647 ----
r = 0;
! while (need_here_doc > 0)
{
parser_state |= PST_HEREDOC;
***************
*** 6076,6079 ****
--- 6076,6080 ----
ps->expand_aliases = expand_aliases;
ps->echo_input_at_read = echo_input_at_read;
+ ps->need_here_doc = need_here_doc;
ps->token = token;
***************
*** 6124,6127 ****
--- 6125,6129 ----
expand_aliases = ps->expand_aliases;
echo_input_at_read = ps->echo_input_at_read;
+ need_here_doc = ps->need_here_doc;
FREE (token);

View File

@ -0,0 +1,24 @@
*** ../bash-4.3-patched/execute_cmd.c 2014-01-31 10:54:52.000000000 -0500
--- execute_cmd.c 2014-06-19 08:05:49.000000000 -0400
***************
*** 2410,2414 ****
lstdin = wait_for (lastpid);
#if defined (JOB_CONTROL)
! exec_result = job_exit_status (lastpipe_jid);
#endif
unfreeze_jobs_list ();
--- 2425,2438 ----
lstdin = wait_for (lastpid);
#if defined (JOB_CONTROL)
! /* If wait_for removes the job from the jobs table, use result of last
! command as pipeline's exit status as usual. The jobs list can get
! frozen and unfrozen at inconvenient times if there are multiple pipelines
! running simultaneously. */
! if (INVALID_JOB (lastpipe_jid) == 0)
! exec_result = job_exit_status (lastpipe_jid);
! else if (pipefail_opt)
! exec_result = exec_result | lstdin; /* XXX */
! /* otherwise we use exec_result */
!
#endif
unfreeze_jobs_list ();

View File

@ -0,0 +1,28 @@
*** ../bash-4.3-patched/parse.y 2014-04-07 11:56:12.000000000 -0400
--- parse.y 2014-06-11 10:25:53.000000000 -0400
***************
*** 2789,2797 ****
case OR_OR:
case '&':
case DO:
case THEN:
case ELSE:
case '{': /* } */
! case '(': /* ) */
case BANG: /* ! time pipeline */
case TIME: /* time time pipeline */
--- 2789,2802 ----
case OR_OR:
case '&':
+ case WHILE:
case DO:
+ case UNTIL:
+ case IF:
case THEN:
+ case ELIF:
case ELSE:
case '{': /* } */
! case '(': /* )( */
! case ')': /* only valid in case statement */
case BANG: /* ! time pipeline */
case TIME: /* time time pipeline */

View File

@ -0,0 +1,18 @@
*** ../bash-4.3-patched/lib/readline/misc.c 2012-09-01 18:03:11.000000000 -0400
--- lib/readline/misc.c 2014-06-30 13:41:19.000000000 -0400
***************
*** 462,465 ****
--- 462,466 ----
/* Set up rl_line_buffer and other variables from history entry */
rl_replace_from_history (entry, 0); /* entry->line is now current */
+ entry->data = 0; /* entry->data is now current undo list */
/* Undo all changes to this history entry */
while (rl_undo_list)
***************
*** 469,473 ****
FREE (entry->line);
entry->line = savestring (rl_line_buffer);
- entry->data = 0;
}
entry = previous_history ();
--- 470,473 ----

29
tests/tests.yml Normal file
View File

@ -0,0 +1,29 @@
---
# Tests that run in classic context
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
repositories:
- repo: "https://src.fedoraproject.org/tests/shell.git"
dest: "shell"
fmf_filter: "tier: 1, 2 & tags: classic"
required_packages:
- expect # login requires expect
- which # smoke requires which
# Tests that run in container and atomic contexts
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- container
- atomic
repositories:
- repo: "https://src.fedoraproject.org/tests/shell.git"
dest: "shell"
fmf_filter: "tier: 1, 2 & tags: container, atomic"
required_packages:
- which # smoke requires which