]> git.pld-linux.org Git - packages/imsettings.git/blob - imsettings-no-bash.patch
- fix -Wformat-security errors
[packages/imsettings.git] / imsettings-no-bash.patch
1 --- imsettings-1.3.0/data/xinput.sh.in.in.orig  2012-07-27 21:01:48.901935186 +0200
2 +++ imsettings-1.3.0/data/xinput.sh.in.in       2012-07-27 21:06:32.818589937 +0200
3 @@ -1,4 +1,4 @@
4 -#!/bin/bash
5 +#!/bin/sh
6  # Copyright (C) 1999-2004,2007-2011 Red Hat, Inc. All rights reserved. This
7  # copyrighted material is made available to anyone wishing to use, modify,
8  # copy, or redistribute it subject to the terms and conditions of the
9 @@ -10,7 +10,7 @@
10  #
11  # X Input method setup script
12  
13 -function log_init() {
14 +log_init() {
15      if [ ! -n "$DRY_RUN" ]; then
16         if [ -f $HOME/.imsettings.log ]; then
17             mv $HOME/.imsettings.log $LOGFILE.bak
18 @@ -20,20 +20,20 @@
19      fi
20  }
21  
22 -function log() {
23 +log() {
24      echo "$@" >> $LOGFILE
25  }
26  
27 -function is_dbus_enabled() {
28 +is_dbus_enabled() {
29      imsettings-check --check-dbus
30      [ $? -eq 0 ]
31  }
32  
33 -function is_imsettings_enabled() {
34 +is_imsettings_enabled() {
35      [ -z "$DISABLE_IMSETTINGS" ] && is_dbus_enabled
36  }
37  
38 -function check_imsettings_capability() {
39 +check_imsettings_capability() {
40      mod=$1
41      imsettings-check --check-modules >/dev/null
42      ret=$?
43 @@ -44,7 +44,7 @@
44      return $ret
45  }
46  
47 -function lookup_desktop() {
48 +lookup_desktop() {
49      ret=$(cat $1)
50      case $ret in
51         gnome*)
52 @@ -65,7 +65,7 @@
53      esac
54  }
55  
56 -function get_desktop() {
57 +get_desktop() {
58      if [ -n "$GDMSESSION" ]; then
59         GUESS_DESKTOP="\$GDMSESSION"
60         echo "$GDMSESSION"
61 @@ -92,7 +92,7 @@
62      fi
63  }
64  
65 -function is_gtk_supported() {
66 +is_gtk_supported() {
67      [ -n "$IMSETTINGS_DISABLE_DESKTOP_CHECK" ] && return 0
68      case "$(get_desktop|tr '[A-Z]' '[a-z]')" in
69         *gnome|openbox)
70 @@ -117,7 +117,7 @@
71      return 1
72  }
73  
74 -function is_qt_supported() {
75 +is_qt_supported() {
76      [ -n "$IMSETTINGS_DISABLE_DESKTOP_CHECK" ] && return 0
77      case "$(get_desktop|tr '[A-Z]' '[a-z]')" in
78         *)
79 @@ -130,7 +130,7 @@
80      return 1
81  }
82  
83 -function is_xim_supported() {
84 +is_xim_supported() {
85      [ -n "$IMSETTINGS_DISABLE_DESKTOP_CHECK" ] && return 0
86      if check_imsettings_capability xim; then
87         return 0
88 @@ -139,7 +139,7 @@
89      return 1
90  }
91  
92 -function setup_gtk_immodule() {
93 +setup_gtk_immodule() {
94      if is_imsettings_enabled && is_gtk_supported; then
95         # Ensure GTK_IM_MODULE is empty. otherwise GTK+ doesn't pick up immodule through XSETTINGS
96         unset GTK_IM_MODULE
97 @@ -149,7 +149,7 @@
98      fi
99  }
100  
101 -function setup_qt_immodule() {
102 +setup_qt_immodule() {
103      if is_imsettings_enabled && is_qt_supported; then
104         # FIXME: Qt doesn't support XSETTINGS for immodule yet.
105         #        We still need to go with the older way.
106 @@ -159,7 +159,7 @@
107      fi
108  }
109  
110 -function setup_xim() {
111 +setup_xim() {
112      if is_imsettings_enabled && is_xim_supported; then
113         # setup XMODIFIERS
114         XMODIFIERS="@im=imsettings"
115 @@ -170,7 +170,7 @@
116      fi
117  }
118  
119 -function run_imsettings() {
120 +run_imsettings() {
121      print_info
122      if [ -n "$DRY_RUN" ]; then
123         log "*** DRY RUN MODE: running IM through imsettings"
124 @@ -185,7 +185,7 @@
125      fi
126  }
127  
128 -function run_xim() {
129 +run_xim() {
130      print_info
131      if [ -n "$DRY_RUN" ]; then
132         log "*** DRY RUN MODE: running IM without imsettings"
133 @@ -198,7 +198,7 @@
134      fi
135  }
136  
137 -function print_result() {
138 +print_result() {
139      $1
140      if [ $? -eq 0 ]; then
141         log yes
142 @@ -207,7 +207,7 @@
143      fi
144  }
145  
146 -function print_info() {
147 +print_info() {
148      log "imsettings information"
149      log "=========================="
150      log "XINPUTRC: $READ_XINPUTRC"
151 @@ -248,13 +248,13 @@
152  unset TERM
153  if [ -r /etc/profile.d/lang.sh ]; then
154      # for Fedora etc
155 -    source /etc/profile.d/lang.sh
156 +    . /etc/profile.d/lang.sh
157  elif [ -r /etc/default/locale ]; then
158      # for Debian
159 -    source /etc/default/locale
160 +    . /etc/default/locale
161  elif [ -r /etc/env.d/02locale ]; then
162      # for Gentoo
163 -    source /etc/env.d/02locale
164 +    . /etc/env.d/02locale
165  fi
166  [ -n "$oldterm" ] && export TERM=$oldterm
167  
168 @@ -271,7 +271,7 @@
169  [ -f "$HOME/.xinputrc.bak" ] && mv $HOME/.xinputrc.bak $CONFIGDIR/xinputrc.bak
170  
171  if [ -r "$USER_XINPUTRC" -a "x$IMSETTINGS_DISABLE_USER_XINPUTRC" = "xno" ]; then
172 -    source "$USER_XINPUTRC"
173 +    . "$USER_XINPUTRC"
174      READ_XINPUTRC=$USER_XINPUTRC
175      if [ ! -h "$USER_XINPUTRC" ]; then
176         SHORT_DESC="User Specific"
177 @@ -283,7 +283,7 @@
178      _sourced_xinputrc=0
179      for i in $_im_language_list; do
180          if echo $tmplang | grep -q -E "^$i"; then
181 -            source "$SYS_XINPUTRC"
182 +            . "$SYS_XINPUTRC"
183              READ_XINPUTRC=$SYS_XINPUTRC
184              _sourced_xinputrc=1
185              break
186 @@ -295,7 +295,7 @@
187          _xcompose_language_list="am_ET el_GR fi_FI pt_BR ru_RU"
188          for i in $_xcompose_language_list; do
189              if echo $tmplang | grep -q -E "^$i"; then
190 -                source @XINPUT_PATH@/xcompose.conf
191 +                . @XINPUT_PATH@/xcompose.conf
192                  _sourced_xinputrc=1
193                  break
194              fi
195 @@ -303,7 +303,7 @@
196      fi
197      if [ $_sourced_xinputrc -eq 0 ]; then
198          # Read none.conf to set up properly for locales not listed the above.
199 -        source @XINPUT_PATH@/none.conf
200 +        . @XINPUT_PATH@/none.conf
201      fi
202  fi
203  
204 --- imsettings-1.2.4/data/xinputinfo.sh.in.orig 2011-03-08 07:39:32.000000000 +0100
205 +++ imsettings-1.2.4/data/xinputinfo.sh.in      2011-07-17 22:57:52.000000000 +0200
206 @@ -1,4 +1,4 @@
207 -#!/bin/bash
208 +#!/bin/sh
209  # xinputinfo.sh
210  # Copyright (C) 2008 Red Hat, Inc. All rights reserved.
211  #
212 @@ -20,7 +20,7 @@
213  # Foundation, Inc., 59 Temple Place - Suite 330,
214  # Boston, MA 02111-1307, USA.
215  
216 -function is_script() {
217 +is_script() {
218      if [ "x$(sed -re '/^[      ]?*[a-zA-Z0-9_]+=.*/{d};/[      ]?*#.*/{d}' $1)" = "x" ]; then
219         return 1
220      else
221 @@ -36,13 +36,13 @@
222  unset TERM
223  if [ -r /etc/profile.d/lang.sh ]; then
224      # for Fedora etc
225 -    source /etc/profile.d/lang.sh
226 +    . /etc/profile.d/lang.sh
227  elif [ -r /etc/default/locale ]; then
228      # for Debian
229 -    source /etc/default/locale
230 +    . /etc/default/locale
231  elif [ -r /etc/env.d/02locale ]; then
232      # for Gentoo
233 -    source /etc/env.d/02locale
234 +    . /etc/env.d/02locale
235  fi
236  [ -n "$oldterm" ] && export TERM=$oldterm
237  
238 @@ -52,16 +52,16 @@
239  unset AUXILIARY_PROGRAM AUXILIARY_ARGS GTK_IM_MODULE ICON IMSETTINGS_IGNORE_ME LONG_DESC PREFERENCE_PROGRAM PREFERENCE_ARGS QT_IM_MODULE SHORT_DESC XIM XIM_PROGRAM XIM_ARGS IS_XIM
240  
241  if [ $# -gt 0 ]; then
242 -    source $1
243 +    . $1
244      IMSETTINGS_FILENAME=$1
245  else
246      [ -z "$IMSETTINGS_DISABLE_USER_XINPUTRC" ] && IMSETTINGS_DISABLE_USER_XINPUTRC=no
247  
248      if [ -r "$USER_XINPUTRC" -a "x$IMSETTINGS_DISABLE_USER_XINPUTRC" = "xno" ]; then
249 -       source "$USER_XINPUTRC"
250 +       . "$USER_XINPUTRC"
251         IMSETTINGS_FILENAME=$USER_XINPUTRC
252      elif [ -r "$SYS_XINPUTRC" ]; then
253 -       source "$SYS_XINPUTRC"
254 +       . "$SYS_XINPUTRC"
255         IMSETTINGS_FILENAME=$SYS_XINPUTRC
256      fi
257  fi
This page took 0.045091 seconds and 3 git commands to generate.