# HG changeset patch # User Rik # Date 1593134403 25200 # Node ID f480103d8333f1f2dfa584c7ff89b90bddfe6328 # Parent 39e6308e4251a5f595dfa361037853e90c08934b Fix unlink() calls in package m-files for new syntax (bug #57830) * pkg.m, build.m, uninstall.m: Call "[~] = unlink (...)" so that error is not thrown and scripts continue even if there was no file to unlink. diff -r 39e6308e4251 -r f480103d8333 scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Thu Jun 25 15:22:37 2020 -0700 +++ b/scripts/pkg/pkg.m Thu Jun 25 18:20:03 2020 -0700 @@ -567,7 +567,7 @@ global_list, global_install); unwind_protect_cleanup - cellfun ("unlink", local_files); + [~] = cellfun ("unlink", local_files); if (exist (tmp_dir, "file")) rmdir (tmp_dir, "s"); endif diff -r 39e6308e4251 -r f480103d8333 scripts/pkg/private/build.m --- a/scripts/pkg/private/build.m Thu Jun 25 15:22:37 2020 -0700 +++ b/scripts/pkg/private/build.m Thu Jun 25 18:20:03 2020 -0700 @@ -95,7 +95,7 @@ ## Currently does nothing because gzip() removes the original tar ## file but that should change in the future (bug #43431). - unlink (tar_path); + [~] = unlink (tar_path); endfor endfunction diff -r 39e6308e4251 -r f480103d8333 scripts/pkg/private/uninstall.m --- a/scripts/pkg/private/uninstall.m Thu Jun 25 15:22:37 2020 -0700 +++ b/scripts/pkg/private/uninstall.m Thu Jun 25 18:20:03 2020 -0700 @@ -32,8 +32,8 @@ global_list, global_install) ## Get the list of installed packages. - [local_packages, global_packages] = installed_packages(local_list, - global_list); + [local_packages, global_packages] = installed_packages (local_list, + global_list); if (global_install) installed_pkgs_lst = {local_packages{:}, global_packages{:}}; else @@ -145,8 +145,8 @@ ## Write a new ~/.octave_packages. if (global_install) - if (length (remaining_packages) == 0) - unlink (global_list); + if (numel (remaining_packages) == 0) + [~] = unlink (global_list); else global_packages = save_order (remaining_packages); if (ispc) @@ -157,8 +157,8 @@ save (global_list, "global_packages"); endif else - if (length (remaining_packages) == 0) - unlink (local_list); + if (numel (remaining_packages) == 0) + [~] = unlink (local_list); else local_packages = save_order (remaining_packages); if (ispc)