1
0

Use setpriv again but now for every file owner

OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-filesystem?expand=0&rev=124
This commit is contained in:
Dr. Werner Fink 2020-02-04 12:23:01 +00:00 committed by Git OBS Bridge
parent aca81012ba
commit dbd7350a97
2 changed files with 37 additions and 16 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Feb 4 12:20:03 UTC 2020 - Dr. Werner Fink <werner@suse.de>
- Again use setpriv but now switch to every single owner for clearing
the files of this owner (boo#1159740)
-------------------------------------------------------------------
Fri Jan 31 12:32:25 UTC 2020 - Dr. Werner Fink <werner@suse.de>

View File

@ -11,6 +11,8 @@ type -f -p kpsewhich >& /dev/null || exit 0
type -f -p mktexlsr >& /dev/null || exit 0
type -f -p find >& /dev/null || exit 0
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
test -r /etc/sysconfig/texlive && . /etc/sysconfig/texlive
@ -18,23 +20,36 @@ OLDIFS=$IFS; IFS=':;'
VARTEXFONTS="$(kpsewhich --expand-var '$VARTEXFONTS' 2> /dev/null)"
IFS=$OLDIFS
if test "$CLEAR_TEXMF_FONTS" = "yes" -a -n "$VARTEXFONTS" ; then
for p in $VARTEXFONTS ; do
test -d $p/pk/ && find $p/pk/ \( -type f -and -atime +20 \) -print0
test -d $p/tfm/ && find $p/tfm/ \( -type f -and -atime +60 \) -print0
test -d $p/source/ && find $p/source/ \( -type f -and -atime +60 \) -print0
done > >(exec -a xargs xargs -r -L100 -0 -- rm -f)
uids=$(find $VARTEXFONTS/ \( -not -type d \) -printf '%U\n' | sort -u)
if test "$CLEAR_TEXMF_FONTS" = "yes" -a -n "$VARTEXFONTS"
then
for uid in ${uids[@]}
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
fi
if test -n "$VARTEXFONTS" ; then
for p in $VARTEXFONTS ; do
test -d $p/pk/ && find $p/pk/ \( -type f -and -not -name '*.*pk' \) -print0
test -d $p/tfm/ && find $p/tfm/ \( -type f -and -not -name '*.tfm' \) -print0
test -d $p/source/ && find $p/source/ \( -type f -and -not -name '*.mf' \) -print0
test -d $p/ && find $p/ \( -type f -and -path '*/[^[:alnum:]]*' \) -print0
done > >(exec -a xargs xargs -r -L100 -0 -- rm -f)
for p in $VARTEXFONTS ; do
test -d $p/ && find $p/ -depth -type d -and -path '*/[^[:alnum:]]*'
done > >(exec -a xargs xargs -r -L100 -0 -- rm -fr)
if test -n "$VARTEXFONTS"
then
for uid in ${uids[@]}
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
fi
#