2 # (c) 1998 Marcelo Magallon <mmagallo@debian.org>
3 # this script is distributed under the terms and conditions of the GPL.
7 # * Fix that ugly hack with fix*
8 # Is there something in the shell like Perl's hashes? It could be nice to
9 # do something like "foreach $var (keys %fixes)" to associate fixes with
10 # file names so I don't have to track things all over the place
12 # * Fix also the code that iterates over user directories to include system
13 # directories in one run
15 # upgrade-windowmaker-defaults (0.3)
17 # * Handles upgrade to Window Maker 0.19.0
18 # Logo.Clip -> Tile.Clip (crashing)
20 # upgrade-windowmaker-defaults (0.2)
22 # * Handles keyname changes between 0.16.1 and 0.17.2
24 # Tue Jul 21 08:05:00 CST 1998
26 # upgrade-windowmaker-defaults (0.1)
29 # * Handles WindowPlaceOrigin syntax change
30 # * Handles name change Fiend -> Clip
32 # Sat Jun 13 16:18:36 CST 1998
34 # Fixes (these are not-optional changes)
35 # this one changes WindowPlaceOrigin = "..." to WindowPlaceOrigin = (...)
36 fix1
='s/\(.*WindowPlaceOrigin = \)"\(.*\)";/\1(\2);/'
37 # and this one substitutes Fiend with Clip
38 fix2
='s/\(.*\)Fiend\(.*\)=/\1Clip\2=/'
39 # this one applies to WMState
40 fix3
='s/\( *\)Fiend\( *\)=/\1Clip\2=/'
41 fix4
='s/\(.*\)Logo\.\(WMFiend\|WMClip\)\(.*\)=/\1Tile.WMClip\3=/'
42 # this one applies to Window Maker
43 fix5
='s/\(.*\)NoSound\(.*\)=/\1DisableSound\2=/'
44 fix6
='s/\(.*\)NoAutoWarp\(.*\)=/\1DontLinkWorspaces\2=/'
45 # this one is for WMWindowAttributes
47 # try to screen system accounts in the /etc/passwd file. If somebody
48 # has a better method for doing this, I'm open to suggestions. Please
49 # note that Debian Policy states accounts 0-99 are reserved for the
50 # Project, and 100 onwards *could* be used by the local sysadmin, but
51 # the default is 1000 and up
52 users
='^[[:alnum:]]*:[[:alnum:]]*:[[:digit:]]\{4,\}:'
72 if [ -e $file_to_fix ] ; then
73 echo -n "Fixing $file_to_fix... "
74 while [ $# -gt 0 ] ; do
75 sed -e "$1" $file_to_fix > $tempfile
76 cat $tempfile > $file_to_fix
86 I can try to fix certain configuration parameters that have changed
87 between previous versions of Window Maker and this one, namely:
89 * WindowPlaceOrigin syntax change from "..." to (...)
90 * Name change of Fiend to Clip
91 * WMWindowAttributes: Logo.Clip -> Tile.Clip (crashing)
93 NOT fixing this could prevent Window Maker from starting. Please read
94 /usr/doc/wmaker/NEWS.gz and /usr/doc/wmaker/changelog.gz
96 I will fix *both* the system defaults and each user's files.
99 if ! ask_n
"Do you want to proceed with the changes" ; then
109 [ $GNUSTEP_USER_ROOT ] && gs_dir
=$GNUSTEP_USER_ROOT
110 gs_defaults
=$gs_dir/Defaults
111 gs_system_defaults
=/etc
/GNUstep
/Defaults
113 if [ "$1" = "--non-interactive" ] || ask_permission
; then
117 for dir
in `cut -d : -f 6 /etc/passwd | sort -u` ; do
118 apply_fix
$dir/$gs_defaults/WindowMaker
"$fix1" "$fix2" "$fix5" "$fix6"
119 apply_fix
$dir/$gs_defaults/WMState
"$fix3"
120 apply_fix
$dir/$gs_defaults/WMWindowAttributes
"$fix4"
124 apply_fix
$gs_system_defaults/WindowMaker
"$fix1" "$fix2" "$fix5" "$fix6"
125 apply_fix
$gs_system_defaults/WMState
"$fix3"
126 apply_fix
$gs_system_defaults/WMWindowAttributes
"$fix4"
132 Done fixing things. If you want to run this script again you can do so by
141 Ok, leaving things as they are now... you can run this script again using:
149 Press [ENTER] to continue...