le-proinfodata: Fix session-setup-script option on lightdm

Signed-off-by: 's avatarDiego Giovane Pasqualin <dpasqualin@c3sl.ufpr.br>
parent 4dc84a28
Package: le-proinfodata
Version: 1.2.40
Version: 1.2.42
Maintainer: <proinfodata@c3sl.ufpr.br>
Architecture: i386
Section: main
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Copyright (C) 2004-2014 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
# This file is part of proinfodata
......@@ -26,6 +26,28 @@ BACKUP_DIR="/opt/seed_mec_backup"
# Set option on lightdm.conf. If the option $1 already exists, make sure it
# has the value $2. If it doesn't exist, add it.
function setLightdmOption() {
local option=$1
local value=$2
if ! grep -q "$option" /etc/lightdm/lightdm.conf; then
sed -i "/\[SeatDefaults\]/ a ${option}=${value}" \
sed -i "/${option}/ s#=.*#=${value}#" \
# Check whether file $1 was already diverted.
# Return true if it was and false otherwise.
function alreadyDiverted() {
dpkg-divert --listpackage $file | grep -q le-proinfodata
return $?
# Descompressing the local base
[[ -f $LBFILE ]] && bunzip2 -f $LBFILE
......@@ -54,15 +76,9 @@ fi
# Set lightdm to open the le-proinfodata configuration script when user
# session starts
if [[ ! -d $MULTISEAT_DIR ]]; then
if ! grep -q "session.*exec_dialog.sh" "/etc/lightdm/lightdm.conf"; then
sed -i '/\[SeatDefaults\]/ a\session-setup-script=/usr/local/bin/exec_dialog.sh' \
sed -i '\,session-setup-script=/usr/local/bin/exec_dialog.sh,d' \
setLightdmOption "session-setup-script" "/usr/local/bin/exec_dialog.sh"
# We will no longer need this files, but as the postrm would only remove the
# diverts when this package were removed, we have to do it here
......@@ -70,9 +86,7 @@ DIVERTS="
/etc/init/tty1.conf \
for file in $DIVERTS; do
# Why the heck dpkg-divert doesn't return 'false' if the pattern doesn't
# match on the --list option?
if [ -n "$(dpkg-divert --list $file)" ]; then
if alreadyDiverted $file; then
dpkg-divert --package le-proinfodata --remove --rename \
--divert ${file}{.real,}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment