a46196a4abf7d6c433c0de2b210b654bb957027e
[easy-deb-chroot] / fremantle / easy-deb-chroot / .py2deb_build_folder / easy-deb-chroot / debian / 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 fi
22
23 # if  [ -f "/home/user/.Xmodmap-keymap.orig" ] ; then
24 #   mv /home/user/.Xmodmap-keymap.orig /home/user/.Xmodmap-keymap
25 #   export UPGRD="upgrade"
26 # fi
27
28 if  [ -f "/home/user/.xbindkeysrc.scm.orig" ] ; then
29   mv /home/user/.xbindkeysrc.scm.orig /home/user/.xbindkeysrc.scm
30 fi
31
32 # if  [ -f "/home/user/.gimp-2.4/gimprc.orig" ] ; then
33 #  mv /home/user/.gimp-2.4/gimprc.orig /home/user/.gimp-2.4/gimprc
34 # fi
35
36 # if  [ -f "/home/user/.gimp-2.4/sessionrc.orig" ] ; then
37 #  mv /home/user/.gimp-2.4/sessionrc.orig /home/user/.gimp-2.4/sessionrc
38 # fi
39
40 # if  [ -f "/home/user/.config/lxde/config.orig" ] ; then
41 #  mv /home/user/.config/lxde/config.orig /home/user/.config/lxde/config
42 # fi
43
44 # if  [ -f "/home/user/.config/lxpanel/LXDE/config.orig" ] ; then
45 #   mv /home/user/.config/lxpanel/LXDE/config.orig /home/user/.config/lxpanel/LXDE/config
46 # fi
47
48 # if  [ -f "/home/user/.config/lxpanel/LXDE/panels/panel.orig" ] ; then
49 #  mv /home/user/.config/lxpanel/LXDE/panels/panel.orig /home/user/.config/lxpanel/LXDE/panels/panel
50 # fi
51
52 # if  [ -f "/home/user/.config/gtk-2.0/gtkfilechooser.ini.orig" ] ; then
53 #  mv /home/user/.config/gtk-2.0/gtkfilechooser.ini.orig /home/user/.config/gtk-2.0/gtkfilechooser.ini
54 # fi
55
56 # Fix permissions; another kludge.
57
58 chown -R user:users /home/user/img-install
59 chown -R user:users /home/user/.chroot
60 # chown -R user:users /home/user/.config
61 # chown -R user:users /home/user/apps
62 # chown -R user:users /home/user/.matchbox
63 # chown user:users /home/user/.Xmodmap-keymap
64 # chown user:users /home/user/.xbindkeysrc.scm
65
66 # yet another kludge; detect an upgrade
67
68 if [ "x$UPGRD" = "x" ] ; then
69    touch /home/user/.synchroot
70    chown -R user:users /home/user/.synchroot
71 fi
72
73 # icon kludges
74
75 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/abiword.png" ] ; then 
76    cp /usr/share/icons/hicolor/scalable/hildon/abiword-debian.png /usr/share/icons/hicolor/scalable/hildon/abiword.png
77 fi
78
79 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png" ] ; then 
80    cp /usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png /usr/share/icons/hicolor/scalable/hildon/deblet.png
81 fi
82
83 # this takes a while; that's why it's at the end...
84 gtk-update-icon-cache -f /usr/share/icons/hicolor
85
86 if [ "x$UPGRD" != "x" ] ; then
87   export MSG1=`printf "\
88 This update points to the new qole.org domain and the updated\n\
89 image file that has the NEW, UPDATED Debian Stable release.\n\n\
90 If you want a fully updated Debian (with OpenOffice.org 3.0,\n\
91 Gimp 2.6, and the Epiphany browser), make sure you \n\
92 close your chroot, delete the current image if you need \n\
93 the space, then use the installer to download \n\
94 the new image file. \n\n\
95 Note: You don't need to replace your current image file."`
96 else
97 export MSG1=`printf "\
98 In order to use this package, you must download and\n\
99 install a very large image file. If you are unsure about\n\
100 how to do this, and / or you just want the current set of\n\
101 Debian applications (OpenOffice, GIMP & Firefox 3  w/ java),\n\
102 use the Debian Image Installer in the Extras menu.\n\
103 This program will download and install the image file to\n\
104 one of your SD cards. You will need at least 1.5 GB free on that\n\
105 card. After you download the image, you can move it elsewhere.\n\
106 After moving the file, you may need to edit the .chroot file \n\
107 as explained on ITt.\n\
108 If you have run any Debian apps, be sure to issue\n\
109 sudo closechroot\n\
110 in the terminal (or just reboot) before moving the image file.\n"`
111 fi
112 gxmessage -center -alignbuttons center -buttons OK:0 -geometry 690x380 -title "NOTICE" "$MSG1"
113
114 exit 0