summaryrefslogtreecommitdiffstats
path: root/Modules/Internal
diff options
context:
space:
mode:
authorsidju <account@sidju.se>2019-08-23 09:15:27 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-23 15:04:26 (GMT)
commit4c8741eb86c6a22298e815c4e34d3ccc0fffe1f4 (patch)
tree24a695de15a515166182220987df7b235a74605e /Modules/Internal
parent68126f5a02b7d21b0d632b9e2c63687b71b3f5fa (diff)
downloadCMake-4c8741eb86c6a22298e815c4e34d3ccc0fffe1f4.zip
CMake-4c8741eb86c6a22298e815c4e34d3ccc0fffe1f4.tar.gz
CMake-4c8741eb86c6a22298e815c4e34d3ccc0fffe1f4.tar.bz2
CPack/STGZ: Require explicit acceptance or refusal of license
To make using the generated STGZ easier, require a specific answer to accepting the license terms. Since more moves down one line when '\n' is entered a user may hold enter to paginate through the document. This change prevents the user from accidentally refusing the license terms by holding enter for too long and having to start over.
Diffstat (limited to 'Modules/Internal')
-rwxr-xr-xModules/Internal/CPack/CPack.STGZ_Header.sh.in22
1 files changed, 13 insertions, 9 deletions
diff --git a/Modules/Internal/CPack/CPack.STGZ_Header.sh.in b/Modules/Internal/CPack/CPack.STGZ_Header.sh.in
index 003fcfe..a857aa5 100755
--- a/Modules/Internal/CPack/CPack.STGZ_Header.sh.in
+++ b/Modules/Internal/CPack/CPack.STGZ_Header.sh.in
@@ -86,15 +86,19 @@ then
@CPACK_RESOURCE_FILE_LICENSE_CONTENT@
____cpack__here_doc____
echo
- echo "Do you accept the license? [yN]: "
- read line leftover
- case ${line} in
- y* | Y*)
- cpack_license_accepted=TRUE;;
- *)
- echo "License not accepted. Exiting ..."
- exit 1;;
- esac
+ while true
+ do
+ echo "Do you accept the license? [yn]: "
+ read line leftover
+ case ${line} in
+ y* | Y*)
+ cpack_license_accepted=TRUE
+ break;;
+ n* | N* | q* | Q* | e* | E*)
+ echo "License not accepted. Exiting ..."
+ exit 1;;
+ esac
+ done
fi
if [ "x${cpack_include_subdir}x" = "xx" ]