Some fixes and cleanup of Fremantle easy-chroot scripts
[easy-deb-chroot] / fremantle / easy-deb-chroot / control / postinst
1 #!/bin/sh
2
3 closechroot
4
5 set -e
6
7 CHROOT=/.debian
8 TSTFILE=/usr/bin/hilda
9
10 if [ ! -d "$CHROOT" ] ; then
11     mkdir /.debian
12 # else
13 #    if [ -f "$CHROOT$TSTFILE" ] || [ ! "x`/sbin/debian echo hello | grep hello`" = "x" ] ; then
14 #       closechroot
15 #       export YESCHROOT='yes'
16 #    fi
17 fi
18
19 # I sincerely apologise for the following ugly kludge that
20 # restores all previous settings.
21
22 if  [ -f "/home/user/.chroot.orig" ] ; then
23   cp /home/user/.chroot.orig /home/user/.chroot
24   export UPGRD="upgrade"
25 fi
26
27 # if  [ -f "/home/user/.Xmodmap-keymap.orig" ] ; then
28 #   mv /home/user/.Xmodmap-keymap.orig /home/user/.Xmodmap-keymap
29 #   export UPGRD="upgrade"
30 # fi
31
32 #if  [ -f "/home/user/.xbindkeysrc.scm.orig" ] ; then
33 #  mv /home/user/.xbindkeysrc.scm.orig /home/user/.xbindkeysrc.scm
34 #fi
35
36 if  [ -f "/home/user/.gimp-2.6/gimprc.orig" ] ; then
37   mv /home/user/.gimp-2.6/gimprc.orig /home/user/.gimp-2.6/gimprc
38 fi
39
40 if  [ -f "/home/user/.gimp-2.6/sessionrc.orig" ] ; then
41   mv /home/user/.gimp-2.6/sessionrc.orig /home/user/.gimp-2.6/sessionrc
42 fi
43
44 # if  [ -f "/home/user/.config/lxde/config.orig" ] ; then
45 #  mv /home/user/.config/lxde/config.orig /home/user/.config/lxde/config
46 # fi
47
48 # if  [ -f "/home/user/.config/lxpanel/LXDE/config.orig" ] ; then
49 #   mv /home/user/.config/lxpanel/LXDE/config.orig /home/user/.config/lxpanel/LXDE/config
50 # fi
51
52 # if  [ -f "/home/user/.config/lxpanel/LXDE/panels/panel.orig" ] ; then
53 #  mv /home/user/.config/lxpanel/LXDE/panels/panel.orig /home/user/.config/lxpanel/LXDE/panels/panel
54 # fi
55
56 # if  [ -f "/home/user/.config/gtk-2.0/gtkfilechooser.ini.orig" ] ; then
57 #  mv /home/user/.config/gtk-2.0/gtkfilechooser.ini.orig /home/user/.config/gtk-2.0/gtkfilechooser.ini
58 # fi
59
60 # Fix permissions; another kludge.
61
62 chown -R user:users /home/user/img-install
63 chown -R user:users /home/user/.chroot
64 chown -R user:users /home/user/.config
65 chown -R user:users /home/user/.gimp-2.6
66 chown user:users /home/user/.gtkrc-2.0
67
68 # chown -R user:users /home/user/apps
69 # chown -R user:users /home/user/.matchbox
70 # chown user:users /home/user/.Xmodmap-keymap
71 # chown user:users /home/user/.xbindkeysrc.scm
72
73 # yet another kludge; detect an upgrade
74
75 if [ "x$UPGRD" = "x" ] ; then
76    touch /home/user/.synchroot
77    chown -R user:users /home/user/.synchroot
78 fi
79
80 # icon kludges
81
82 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/abiword.png" ] ; then 
83    cp /usr/share/icons/hicolor/scalable/hildon/abiword-debian.png /usr/share/icons/hicolor/scalable/hildon/abiword.png
84 fi
85
86 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png" ] ; then 
87    cp /usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png /usr/share/icons/hicolor/scalable/hildon/deblet.png
88 fi
89
90 # this takes a while; that's why it's at the end...
91 gtk-update-icon-cache -f /usr/share/icons/hicolor
92
93 if [ "x$UPGRD" != "x" ] ; then
94   export MSG1=`printf "\
95 This update fixes keyboard issues in LXDE under Fremantle.\n\n\
96 If you want the new features, make sure you close your chroot, \n\
97 delete the current image if you need the space, then use \n\
98 the installer to download the new image file. \n\n\
99 Note: You don't need to replace your current image file."`
100 else
101 export MSG1=`printf "\
102 In order to use this package, you must download and\n\
103 install a very large image file. If you are unsure about\n\
104 how to do this, and / or you just want the current set of\n\
105 Debian applications (OpenOffice, GIMP & Firefox 3  w/ java),\n\
106 use the Debian Image Installer in the Extras menu.\n\
107 This program will download and install the image file to\n\
108 one of your SD cards. You will need at least 1.5 GB free on that\n\
109 card. After you download the image, you can move it elsewhere.\n\
110 After moving the file, you may need to edit the .chroot file \n\
111 as explained on ITt.\n\
112 If you have run any Debian apps, be sure to issue\n\
113 sudo closechroot\n\
114 in the terminal (or just reboot) before moving the image file.\n"`
115 fi
116 gxmessage -center -alignbuttons center -buttons OK:0 -geometry 690x380 -title "NOTICE" "$MSG1"
117
118 exit 0