[LyX/master] Make the directories in LyX application bundle read only.

Jean-Marc Lasgouttes lasgouttes at lyx.org
Fri Feb 21 17:28:24 UTC 2020


Le 21/02/2020 à 17:45, Stephan Witt a écrit :
> commit ca7defab45a685bbc0303c32b94afb5ec98d4118
> Author: Stephan Witt <switt at lyx.org>
> Date:   Fri Feb 21 18:04:28 2020 +0100
> 
>      Make the directories in LyX application bundle read only.
>      
>      Python produces files with cached on-the-fly compiled code on disk inside the bundle.
>      This should be avoided in case of a signed application bundle.

Are the .pyc file still present? I think they are needed 
performance-wise (for startup time).

I am not sure about the portability, though. Assuming we require python3 
are there different pyc versions?

JMarc

> ---
>   development/LyX-Mac-binary-release.sh |    8 ++++++--
>   1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/development/LyX-Mac-binary-release.sh b/development/LyX-Mac-binary-release.sh
> index 8b8c54e..acde8c1 100644
> --- a/development/LyX-Mac-binary-release.sh
> +++ b/development/LyX-Mac-binary-release.sh
> @@ -638,7 +638,10 @@ LYX_BUNDLE_PATH="${LyxAppPrefix}/${BUNDLE_PATH}"
>   build_lyx() {
>   	# Clear Output
>   	if [ -n "${LyxAppZip}" -a -f "${LyxAppZip}" ]; then rm "${LyxAppZip}"; fi
> -	if [ -d "${LyxAppPrefix}" ]; then rm -rf "${LyxAppPrefix}"; fi
> +	if [ -d "${LyxAppPrefix}" ]; then
> +		find "${LyxAppPrefix}" -type d -exec chmod u+w '{}' \;
> +		rm -rf "${LyxAppPrefix}"
> +	fi
>   
>   	case "${EnableCXX11}" in
>   	"--enable-cxx11")
> @@ -1018,7 +1021,7 @@ make_dmg() {
>   	VOLUME=$(mount |grep ${DEVICE} | cut -f 3 -d ' ')
>   
>   	# copy in the application bundle
> -	ditto --hfsCompression "${LyxAppDir}.app" "${VOLUME}/${LyxName}.app"
> +	ditto --hfsCompression "${LyxAppPrefix}" "${VOLUME}/${LyxName}.app"
>   
>   	# copy in background image
>   	mkdir -p "${VOLUME}/Pictures"
> @@ -1072,5 +1075,6 @@ if [ ${LyxOnlyPackage:-"no"} = "no" ]; then
>   	convert_universal
>   	copy_dictionaries
>   	test -n "${CODESIGN_IDENTITY}" && code_sign "${LYX_BUNDLE_PATH}"
> +	find "${LyxAppPrefix}" -type d -exec chmod a-w '{}' \;
>   fi
>   build_package
> 



More information about the lyx-devel mailing list