From 6c2eb5a49c32dc5bc2c68681a99c799e5dbe8211 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 28 Feb 2024 20:04:39 -0300 Subject: feat: better error message when lacking permissions The lock error message has clobbered the check_command_permissions error message. This is an interim solution, but we should probably move the permissions check further up for a more informative error. --- spec/quick/build.q | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'spec') diff --git a/spec/quick/build.q b/spec/quick/build.q index ee519adf..55bb7519 100644 --- a/spec/quick/build.q +++ b/spec/quick/build.q @@ -83,8 +83,15 @@ RUN: luarocks build --tree=/usr ./a_rock-1.0.1-rockspec EXIT: 4 STDERR: -------------------------------------------------------------------------------- -requires exclusive access -use --force-lock +requires exclusive write access +-------------------------------------------------------------------------------- + +We show the OS permission denied error, so we don't show the --force-lock +message. + +NOT_STDERR: +-------------------------------------------------------------------------------- +try --force-lock -------------------------------------------------------------------------------- NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec @@ -93,8 +100,15 @@ RUN: luarocks build --tree=/usr ./a_rock-1.0.1-rockspec --force-lock EXIT: 4 STDERR: -------------------------------------------------------------------------------- -requires exclusive access -failed to force the lock +requires exclusive write access +-------------------------------------------------------------------------------- + +We show the OS permission denied error, so we don't show the --force-lock +message. + +NOT_STDERR: +-------------------------------------------------------------------------------- +try --force-lock -------------------------------------------------------------------------------- NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec @@ -108,8 +122,15 @@ RUN: luarocks build --tree=/usr/invalid ./a_rock-1.0.1-rockspec EXIT: 4 STDERR: -------------------------------------------------------------------------------- -requires exclusive access -use --force-lock +requires exclusive write access +-------------------------------------------------------------------------------- + +We show the OS permission denied error, so we don't show the --force-lock +message. + +NOT_STDERR: +-------------------------------------------------------------------------------- +try --force-lock -------------------------------------------------------------------------------- NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec @@ -118,7 +139,7 @@ RUN: luarocks build --tree=/usr/invalid ./a_rock-1.0.1-rockspec --force-lock EXIT: 4 STDERR: -------------------------------------------------------------------------------- -requires exclusive access +requires exclusive write access failed to force the lock -------------------------------------------------------------------------------- -- cgit v1.2.3-55-g6feb