Commit 2f12c379 authored by Klismann Smoger Mottin's avatar Klismann Smoger Mottin
Browse files

le-interface: Fix wrong move command with dpkg-divert

The previous version used the Unix "mv" command to overwrite some files.
The correct way of doing that is with dpkg-divert.
parent ad2797c5
#!/bin/bash
# Copyright (C) 2011-2012 Centro de Computacao Cientifica e Software Livre
#
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-interface
......@@ -9,7 +9,7 @@
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#!/bin/bash
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
......@@ -19,9 +19,29 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
mv "/usr/share/gnome-shell/theme/gnome-shell" "/usr/share/gnome-shell/theme/gnome-shell.css"
mv "/usr/share/gnome-shell/js/ui/panel" "/usr/share/gnome-shell/js/ui/panel.js"
mv "/usr/share/gnome-shell/js/ui/dateMenu" "/usr/share/gnome-shell/js/ui/dateMenu.js"
mv "/usr/share/icons/gnome/22x22/places/ubuntu-logo.png.new" "/usr/share/icons/gnome/22x22/places/ubuntu-logo.png"
mv "/usr/share/icons/gnome/24x24/places/ubuntu-logo.png.new" "/usr/share/icons/gnome/24x24/places/ubuntu-logo.png"
mv "/usr/share/icons/gnome/32x32/places/ubuntu-logo.png.new" "/usr/share/icons/gnome/32x32/places/ubuntu-logo.png"
# Paths
GNOMESHELL="/usr/share/gnome-shell"
GNOMEICONS="/usr/share/icons/gnome"
# List of files to divert
divertList="
$GNOMESHELL/theme/gnome-shell.css \
$GNOMESHELL/js/ui/panel.js \
$GNOMESHELL/js/ui/dateMenu.js \
$GNOMEICONS/22x22/places/ubuntu-logo.png \
$GNOMEICONS/24x24/places/ubuntu-logo.png \
$GNOMEICONS/32x32/places/ubuntu-logo.png \
"
# Divert files
if [[ "$1" != "upgrade" ]]; then
for file in $divertList; do
if test -e $file.real; then
rm -f $file
dpkg-divert --package le-interface --remove --rename \
--divert $file{.real,}
fi
done
fi
......@@ -20,9 +20,23 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
mv "/usr/share/gnome-shell/theme/gnome-shell.css" "/usr/share/gnome-shell/theme/gnome-shell.css.old"
mv "/usr/share/gnome-shell/js/ui/panel.js" "/usr/share/gnome-shell/js/ui/panel.js.old"
mv "/usr/share/gnome-shell/js/ui/dateMenu.js" "/usr/share/gnome-shell/js/ui/dateMenu.js.old"
mv "/usr/share/icons/gnome/22x22/places/ubuntu-logo.png" "/usr/share/icons/gnome/22x22/places/ubuntu-logo.png.old"
mv "/usr/share/icons/gnome/24x24/places/ubuntu-logo.png" "/usr/share/icons/gnome/24x24/places/ubuntu-logo.png.old"
mv "/usr/share/icons/gnome/32x32/places/ubuntu-logo.png" "/usr/share/icons/gnome/32x32/places/ubuntu-logo.png.old"
# Paths
GNOMESHELL=/usr/share/gnome-shell
GNOMEICONS=/usr/share/icons/gnome
# List of files to divert
divertList="
$GNOMESHELL/theme/gnome-shell.css \
$GNOMESHELL/js/ui/panel.js \
$GNOMESHELL/js/ui/dateMenu.js \
$GNOMEICONS/22x22/places/ubuntu-logo.png \
$GNOMEICONS/24x24/places/ubuntu-logo.png \
$GNOMEICONS/32x32/places/ubuntu-logo.png \
"
# Divert files
for file in $divertList; do
dpkg-divert --package le-interface --add --rename \
--divert $file{.real,}
done
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