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