Applied as obvious. * tests/demo-noinst-link.test (func_save_files): set the restore trap outside a function, otherwise AIX 5.3 /bin/sh will run the trap at the end of the function, instead of when the script exits. * tests/demo-relink.test (func_save_files): Ditto. * tests/depdemo-relink.test (func_save_files): Ditto. Reported by Stefano Lattarini.
Signed-off-by: Gary V. Vaughan <g...@gnu.org> --- tests/demo-noinst-link.test | 5 ++++- tests/demo-relink.test | 4 +++- tests/depdemo-relink.test | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/demo-noinst-link.test b/tests/demo-noinst-link.test index 5e658b0..5654ff9 100755 --- a/tests/demo-noinst-link.test +++ b/tests/demo-noinst-link.test @@ -38,13 +38,16 @@ func_save_files () func_mkdir_p "$objdir/temp/libs" cp -f libhello.la "hell$EXEEXT" "$objdir/temp" cp -f "$objdir"/* "$objdir"/temp/libs - trap "func_restore_files" 0 1 2 13 15 } func_require "demo-inst" "$prefix/lib/libhello.la" func_mkprefixdir func_cd "tests/demo" + +# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a +# function, so we set the trap outside of a function to be portable. +trap func_restore_files 0 1 2 13 15 func_save_files func_msg "removing \`libhello.la' and \`hell' from demo" diff --git a/tests/demo-relink.test b/tests/demo-relink.test index b463441..4b32fba 100755 --- a/tests/demo-relink.test +++ b/tests/demo-relink.test @@ -37,7 +37,6 @@ func_save_files () func_mkdir_p "$objdir/temp/libs" cp -f libhello.la "$objdir/temp" cp -f "$objdir"/libhello.* "$objdir/lt-hell$EXEEXT" "$objdir/temp/libs" - trap "func_restore_files" 0 1 2 13 15 } func_require "demo-inst" "$prefix/lib/libhello.la" "tests/demo/libhello.la" @@ -50,7 +49,10 @@ func_get_config "library_names" "cat libhello.la" test -z "$library_names" \ && func_skip "Exiting: demo/libhello.la is not a shared library" +# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a +# function, so we set the trap outside of a function to be portable. func_save_files +trap func_restore_files 0 1 2 13 15 func_get_config 'shlibpath_overrides_runpath hardcode_action diff --git a/tests/depdemo-relink.test b/tests/depdemo-relink.test index 382f36c..0d01279 100755 --- a/tests/depdemo-relink.test +++ b/tests/depdemo-relink.test @@ -47,7 +47,6 @@ func_save_files () && cp -f "$objdir/depdemo$EXEEXT" "_fnord/temp" cp -f l3/libl3.la "_fnord/temp" cp -f l3/"$objdir"/* "_fnord/temp/libs" - trap "func_restore_files" 0 1 2 13 15 } func_require "depdemo-inst" "$prefix/lib/libl3.la" "tests/depdemo/l3/libl3.la" @@ -60,6 +59,9 @@ func_get_config "library_names" "cat l3/libl3.la" test -z "$library_names" \ && func_skip "Exiting: depdemo/l3/libl3.la is not a shared library" +# AIX 5.3 `/bin/sh' will invoke the trap for 0 at the end of a +# function, so we set the trap outside of a function to be portable. +trap func_restore_files 0 1 2 13 15 func_save_files func_get_config 'shlibpath_overrides_runpath -- 1.7.8 Cheers, -- Gary V. Vaughan (gary AT gnu DOT org)