From fe08802a26982b0be92a89b552a3a6c02eedcb61958cbdf7eb9e86c3f509bdbe Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 23 Mar 2020 16:21:14 +0000 Subject: [PATCH] HAVE_MKTEX_MEMBERS OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=133 --- rc.config.texlive | 13 +++++++++ texlive-filesystem.changes | 8 +++++ texlive-filesystem.spec | 26 ++++++++--------- texlive.cron | 60 ++++++++++++++++++++++++-------------- 4 files changed, 72 insertions(+), 35 deletions(-) diff --git a/rc.config.texlive b/rc.config.texlive index 67a0626..2a459e3 100644 --- a/rc.config.texlive +++ b/rc.config.texlive @@ -10,3 +10,16 @@ # will be cleared from fonts not used in the last 20 days. # CLEAR_TEXMF_FONTS="no" + +## Type: yesno +## Default: no +## Command: +# +# If above is set to yes and there are users which are member +# of the group mktex then it might be that users have set an +# umask which does not allow the user mktex to clear the cache +# below /var/cache/fonts/. Setting HAVE_MKTEX_MEMBERS to "yes" +# will allow the cron job to change the group mask hence allow +# to clear older data. +# +HAVE_MKTEX_MEMBERS="no" diff --git a/texlive-filesystem.changes b/texlive-filesystem.changes index c5b985a..166f262 100644 --- a/texlive-filesystem.changes +++ b/texlive-filesystem.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Mar 23 16:18:13 UTC 2020 - Dr. Werner Fink + +- Add new configuration variable HAVE_MKTEX_MEMBERS to texlive + sysconfig file to control the behaviour of the cron job. +- Change the cron job to clear data of other users which are + member of the group mktex + ------------------------------------------------------------------- Wed Mar 11 16:03:20 UTC 2020 - Dr. Werner Fink diff --git a/texlive-filesystem.spec b/texlive-filesystem.spec index 55f0a8c..7d74dab 100644 --- a/texlive-filesystem.spec +++ b/texlive-filesystem.spec @@ -15305,13 +15305,13 @@ popd %{_texmfvardir}/fonts/dvips/ root:root 1755 %{_texmfvardir}/fonts/pdftex/ root:root 1755 %{_texmfcache}/ root:root 1755 - %{_fontcache}/ %{texusr}:%{texgrp} 1775 - %{_fontcache}/pk/ %{texusr}:%{texgrp} 1775 - %{_fontcache}/source/ %{texusr}:%{texgrp} 1775 - %{_fontcache}/tfm/ %{texusr}:%{texgrp} 1775 + %{_fontcache}/ %{texusr}:%{texgrp} 3775 + %{_fontcache}/pk/ %{texusr}:%{texgrp} 3775 + %{_fontcache}/source/ %{texusr}:%{texgrp} 3775 + %{_fontcache}/tfm/ %{texusr}:%{texgrp} 3775 EOF (cat > %{buildroot}%{_sysconfdir}/permissions.d/texlive) <<-EOF - %{_libexecdir}/mktex/public root:%{texgrp} 0755 + %{_libexecdir}/mktex/public root:%{texgrp} 2755 %{_texmfconfdir}/ls-R root:%{texgrp} 0664 %{_fontcache}/ls-R %{texusr}:%{texgrp} 0664 %{_texmfvardir}/ls-R root:%{texgrp} 0664 @@ -15325,10 +15325,10 @@ popd %{_texmfvardir}/fonts/dvips/ root:root 1755 %{_texmfvardir}/fonts/pdftex/ root:root 1755 %{_texmfcache}/ root:root 1755 - %{_fontcache}/ %{texusr}:%{texgrp} 1775 - %{_fontcache}/pk/ %{texusr}:%{texgrp} 1775 - %{_fontcache}/source/ %{texusr}:%{texgrp} 1775 - %{_fontcache}/tfm/ %{texusr}:%{texgrp} 1775 + %{_fontcache}/ %{texusr}:%{texgrp} 3775 + %{_fontcache}/pk/ %{texusr}:%{texgrp} 3775 + %{_fontcache}/source/ %{texusr}:%{texgrp} 3775 + %{_fontcache}/tfm/ %{texusr}:%{texgrp} 3775 EOF %if %{with zypper_posttrans} @@ -26869,10 +26869,10 @@ rm -f /var/run/texlive/run-update %dir %attr(1755,root,root) %{_texmfvardir}/web2c/tex %dir %attr(1755,root,root) %{_texmfvardir}/web2c/xetex %dir %attr(1755,root,root) %{_texmfcache} -%dir %attr(1775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache} -%dir %attr(1775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache}/pk -%dir %attr(1775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache}/source -%dir %attr(1775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache}/tfm +%dir %attr(3775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache} +%dir %attr(3775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache}/pk +%dir %attr(3775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache}/source +%dir %attr(3775,%{texusr},%{texgrp}) %verify(not mode) %{_fontcache}/tfm %dir %{_texmfvardir}/md5 %verify(link) %{_texmfmaindir}/ls-R %verify(link) %{_texmfdistdir}/ls-R diff --git a/texlive.cron b/texlive.cron index 452d6c9..0e2a7df 100644 --- a/texlive.cron +++ b/texlive.cron @@ -14,42 +14,58 @@ type -f -p xargs >& /dev/null || exit 0 type -f -p setpriv >& /dev/null || exit 0 type -f -p sort >& /dev/null || exit 0 type -f -p rm >& /dev/null || exit 0 +type -f -p seq >& /dev/null || exit 0 +type -f -p getent >& /dev/null || exit 0 test -r /etc/sysconfig/texlive && . /etc/sysconfig/texlive OLDIFS=$IFS; IFS=':;' VARTEXFONTS="$(kpsewhich --expand-var '$VARTEXFONTS' 2> /dev/null)" IFS=$OLDIFS -uids=$(find $VARTEXFONTS/ \( -not -type d \) -printf '%U\n' | sort -u) +if test -n "$VARTEXFONTS" -a "$HAVE_MKTEX_MEMBERS" = yes +then + IFS=: + users=($(getent group mktex)) + IFS=$OLDIFS + typeset -i i + typeset -i u=${#users[*]} + let u-- + for p in $VARTEXFONTS + do + test -d $p || continue + for i in $(seq 3 $u) + do + find -P $p \( \( -type f -and -not -type l \) -and -user ${users[$i]} \) -print0 | \ + xargs -r -L100 -0 -- setpriv --reuid ${users[$i]} --regid mktex --init-groups chmod g+rw + find -P $p \( \( -type d -and -not -type l \) -and -user ${users[$i]} \) -print0 | \ + xargs -r -L100 -0 -- setpriv --reuid ${users[$i]} --regid mktex --init-groups chmod g+rwsx + done + done + unset i u +fi if test "$CLEAR_TEXMF_FONTS" = "yes" -a -n "$VARTEXFONTS" then - for uid in ${uids[@]} + for p in $VARTEXFONTS do - for p in $VARTEXFONTS - do - test -d $p/pk/ && find $p/pk/ \( -not -type d -and -atime +20 -and -uid $uid \) -print0 - test -d $p/tfm/ && find $p/tfm/ \( -not -type d -and -atime +60 -and -uid $uid \) -print0 - test -d $p/source/ && find $p/source/ \( -not -type d -and -atime +60 -and -uid $uid \) -print0 - done > >(exec -a xargs xargs -r -L100 -0 -- setpriv --reuid $uid --regid mktex --init-groups rm -f) - done + test -d $p/pk && find -P $p/pk \( -not -type d -and -atime +20 \) -print0 + test -d $p/tfm && find -P $p/tfm \( -not -type d -and -atime +60 \) -print0 + test -d $p/source && find -P $p/source \( -not -type d -and -atime +60 \) -print0 + done > >(exec -a xargs xargs -r -L100 -0 -- setpriv --reuid mktex --regid mktex --init-groups rm -f) fi if test -n "$VARTEXFONTS" then - for uid in ${uids[@]} + for p in $VARTEXFONTS do - for p in $VARTEXFONTS - do - test -d $p/pk/ && find $p/pk/ \( -not -type d -and -not -name '*.*pk' -uid $uid \) -print0 - test -d $p/tfm/ && find $p/tfm/ \( -not -type d -and -not -name '*.tfm' -uid $uid \) -print0 - test -d $p/source/ && find $p/source/ \( -not -type d -and -not -name '*.mf' -uid $uid \) -print0 - test -d $p/ && find $p/ \( -not -type d -and -path '*/[^[:alnum:]]*' -uid $uid \) -print0 - done > >(exec -a xargs xargs -r -L100 -0 -- setpriv --reuid $uid --regid mktex --init-groups rm -vf) - for p in $VARTEXFONTS - do - test -d $p/ && find $p/ -depth \( -type d -and -path '*/[^[:alnum:]]*' -and -uid $uid \) -print0 - done > >(exec -a xargs xargs -r -L100 -0 -- setpriv --reuid $uid --regid mktex --init-groups rm -vfr) - done + test -d $p/pk && find -P $p/pk \( -not -type d -and -not -name '*.*pk' \) -print0 + test -d $p/tfm && find -P $p/tfm \( -not -type d -and -not -name '*.tfm' \) -print0 + test -d $p/source && find -P $p/source \( -not -type d -and -not -name '*.mf' \) -print0 + test -d $p && find -P $p \( -not -type d -and -path '*/[^[:alnum:]]*' \) -print0 + done > >(exec -a xargs xargs -r -L100 -0 -- setpriv --reuid mktex --regid mktex --init-groups rm -vf) + for p in $VARTEXFONTS + do + test -d $p && find -P $p -depth \( -type d -and -path '*/[^[:alnum:]]*' \) -print0 + done > >(exec -a xargs xargs -r -L100 -0 -- setpriv --reuid mktex --regid mktex --init-groups rm -vfr) fi #