Skip to content
Snippets Groups Projects
Commit 774bc1ac authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

le-greeter: Only divert files when needed

parent 16e40001
No related branches found
No related tags found
No related merge requests found
Package: le-greeter
Priority: important
Section: main
Version: 0.1.37
Version: 0.1.38
Maintainer: LE Maintainer <le-maintainer@c3sl.ufpr.br>
Description: Login screen theme and configurations for Linux Educacional 5.0
Architecture: i386
......
......@@ -24,17 +24,29 @@
RMDIVERTS="/etc/lightdm/lightdm.conf"
DIVERTS="/usr/sbin/guest-account"
# Check whether file $1 was already diverted.
# Return true if it was and false otherwise.
function alreadyDiverted() {
file="$1"
dpkg-divert --listpackage $file | grep -q le-greeter
return $?
}
# Remove diverts made from previous versions of le-greeter (<0.1.36)
for file in $RMDIVERTS; do
dpkg-divert --remove ${file}
if test -e ${file}.lightdm; then
rm -f ${file}.lightdm
if alreadyDiverted $file; then
dpkg-divert --remove ${file}
if test -e ${file}.lightdm; then
rm -f ${file}.lightdm
fi
fi
done
# Divert files:
for file in $DIVERTS; do
dpkg-divert --divert ${file}.lightdm --rename ${file}
if ! alreadyDiverted $file; then
dpkg-divert --divert ${file}.real --rename ${file}
fi
done
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment