starttde: Replace -nt operator (bashishm) with a portable solution

Signed-off-by: Matías Fonzo <selk@dragora.org>
(cherry picked from commit c7474d81e9)
pull/182/head
Matías Fonzo 4 years ago committed by Slávek Banko
parent ac70ac954a
commit 670087710a
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -68,6 +68,15 @@ remove_from_path() {
eval export $var=${NPATH#:} eval export $var=${NPATH#:}
} }
# Portable alternative to the file operator -nt (among shells)
is_newer() {
if test -n "$(find $1 -prune -newer $2 -print)"
then
return 0
fi
return 1
}
echo "[starttde] Starting starttde." 1>&2 echo "[starttde] Starting starttde." 1>&2
echo "[starttde] This script is $0" 1>&2 echo "[starttde] This script is $0" 1>&2
@ -689,10 +698,14 @@ EXIT_CODE="$?"
# Remove moodin cache if we have a new wallpaper installed, jriddell. Distro-specific. # Remove moodin cache if we have a new wallpaper installed, jriddell. Distro-specific.
if [ -d "$tdehome/share/apps/ksplash/cache/Moodin/kubuntu" ]; then if [ -d "$tdehome/share/apps/ksplash/cache/Moodin/kubuntu" ]; then
if [ /usr/share/wallpapers/kubuntu-wallpaper.png -nt "$tdehome/share/apps/ksplash/cache/Moodin/kubuntu/" ]; then if is_newer /usr/share/wallpapers/kubuntu-wallpaper.png \
"$tdehome/share/apps/ksplash/cache/Moodin/kubuntu/"
then
rm -rf "$tdehome/share/apps/ksplash/cache/Moodin/kubuntu/" rm -rf "$tdehome/share/apps/ksplash/cache/Moodin/kubuntu/"
fi fi
fi fi
# The is_newer function will no longer be used, so we unset it
unset is_newer
if test -z "$dl"; then if test -z "$dl"; then
# The splashscreen and progress indicator. # The splashscreen and progress indicator.

Loading…
Cancel
Save