Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/xdg-utils/scripts/xdg-desktop-menu.in

Issue 151098: Patch from mdm@google.com... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-desktop-menu ('k') | third_party/xdg-utils/scripts/xdg-email » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/sh
2 #---------------------------------------------
3 # xdg-desktop-menu
4 #
5 # Utility script to install menu items on a Linux desktop.
6 # Refer to the usage() function below for usage.
7 #
8 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
9 # Copyright 2006, Jeremy White <jwhite@codeweavers.com>
10 #
11 # LICENSE:
12 #
13 #---------------------------------------------
14
15 manualpage()
16 {
17 cat << _MANUALPAGE
18 _MANUALPAGE
19 }
20
21 usage()
22 {
23 cat << _USAGE
24 _USAGE
25 }
26
27 #@xdg-utils-common@
28
29 update_desktop_database()
30 {
31 # echo Update desktop database: $mode
32 if [ "$mode" = "system" ] ; then
33 for x in `echo $PATH | sed 's/:/ /g'` /opt/gnome/bin; do
34 if [ -x $x/update-desktop-database ] ; then
35 DEBUG 1 "Running $x/update-desktop-database"
36 eval '$x/update-desktop-database'$xdg_redirect_output
37 return
38 fi
39 done
40 fi
41 }
42
43 fixup_mandriva_categories()
44 {
45 DEBUG 1 "fixup_mandriva_categories $1"
46 awk '
47 BEGIN {
48 xlat["AudioVideo"]="X-Mandrakelinux-Multimedia;X-MandrivaLinux-Multimedia"
49 xlat["Development"]="X-Mandrakelinux-MoreApplications-Development;X-Mandriva Linux-MoreApplications-Development"
50 xlat["Education"]="X-Mandrakelinux-MoreApplications;X-MandrivaLinux-MoreAppl ications-Education"
51 xlat["Game"]="X-Mandrakelinux-MoreApplications;X-MandrivaLinux-MoreApplicati ons-Games"
52 xlat["Graphics"]="X-Mandrakelinux-Multimedia-Graphics"
53 xlat["Network"]="X-Mandrakelinux-Internet;X-MandrivaLinux-Internet"
54 xlat["Office"]="X-Mandrakelinux-Office;X-MandrivaLinux-Office"
55 xlat["System"]="X-Mandrakelinux-System;X-MandrivaLinux-System"
56 xlat["Utility"]="X-Mandrakelinux-Office-Accessories;X-MandrivaLinux-Office-A ccessories"
57 }
58 {
59 if (match($0,/Categories=/)) {
60 split(substr($0,RSTART+11),categories,";")
61 result=""
62 for (n in categories)
63 {
64 if (categories[n] in xlat)
65 categories[n]=categories[n] ";" xlat[categories[n]]
66 if (categories[n])
67 result=result categories[n] ";"
68 }
69 print "Categories=" result
70 }
71 else
72 {
73 print $0
74 }
75 }' $1 > $1.new
76 mv $1.new $1
77 }
78
79 # Make application $1/$2 the default for all the mimetypes it support,
80 # iff such mimetype didn't had a default application already.
81 # $1 Install dir for desktop file
82 # $2 base name of desktop file
83 make_lazy_default()
84 {
85 local mimetypes
86 local xdg_user_dir
87 local xdg_default_dirs
88
89 DEBUG 1 "make_lazy_default $1/$2"
90 mimetypes=`awk '
91 {
92 if (match($0,/MimeType=/)) {
93 split(substr($0,RSTART+9),mimetypes,";")
94 for (n in mimetypes)
95 {
96 if (mimetypes[n])
97 print mimetypes[n]
98 }
99 }
100 }' "$1/$2" 2> /dev/null`
101
102 for MIME in $mimetypes ; do
103 xdg_default_dirs="$XDG_DATA_DIRS"
104 [ -n "$xdg_default_dirs" ] || xdg_default_dirs=/usr/local/share/:/usr/sh are/
105 if [ x"$mode" = x"user" ] ; then
106 xdg_user_dir="$XDG_DATA_HOME"
107 [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
108 xdg_default_dirs="$xdg_user_dir:$xdg_default_dirs"
109 fi
110 local default_app
111 for x in `echo "$xdg_default_dirs" | sed 's/:/ /g'`; do
112 DEBUG 2 "Checking $x/applications/defaults.list"
113 default_app=`grep "$MIME=" $x/applications/defaults.list 2> /dev/nul l | cut -d '=' -f 2`
114 if [ -n "$default_app" ] ; then
115 DEBUG 2 "Found default apps for $MIME: $default_app"
116 default_app="$default_app;"
117 break;
118 fi
119 done
120 DEBUG 2 "Current default apps for $MIME: $default_app"
121 if echo "$default_app" | grep "$2" > /dev/null 2> /dev/null; then
122 # App already listed as default
123 continue;
124 fi
125 default_file="$1/defaults.list"
126 DEBUG 1 "Updating $default_file"
127 grep -v "$MIME=" $default_file > ${default_file}.new 2> /dev/null
128 if ! grep "[Default Applications]" ${default_file}.new > /dev/null; then
129 echo "[Default Applications]" >> ${default_file}.new
130 fi
131 echo $MIME="$default_app$2" >> ${default_file}.new
132 mv ${default_file}.new $default_file
133 done
134 }
135
136 update_submenu()
137 {
138 DEBUG 1 "update_submenu $1"
139 menu_file="$1"
140
141 xdg_dir_name=menus
142 xdg_user_dir="$XDG_CONFIG_HOME"
143 [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.config"
144 xdg_user_dir="$xdg_user_dir/$xdg_dir_name"
145
146 xdg_system_dirs="$XDG_CONFIG_DIRS"
147 [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/etc/xdg
148 xdg_global_dir=
149 for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
150 if [ -w $x/$xdg_dir_name ] ; then
151 xdg_global_dir="$x/$xdg_dir_name"
152 break
153 fi
154 done
155 xdg_user_dir="$xdg_user_dir/applications-merged"
156 xdg_global_dir="$xdg_global_dir/applications-merged"
157
158 DEBUG 3 "Install locations for *.menu file:"
159 DEBUG 3 "xdg_user_dir: $xdg_user_dir"
160 DEBUG 3 "xdg_global_dir: $xdg_global_dir"
161 DEBUG 3 "kde_user_dir: $kde_user_dir"
162 DEBUG 3 "kde_global_dir: $kde_global_dir"
163 DEBUG 3 "gnome_user_dir: $gnome_user_dir"
164 DEBUG 3 "gnome_global_dir: $gnome_global_dir"
165
166 if [ x"$mode" = x"user" ] ; then
167 xdg_dir="$xdg_user_dir"
168 kde_dir="$kde_user_dir"
169 gnome_dir="$gnome_user_dir"
170 my_umask=077
171 my_chmod=0600
172 else
173 xdg_dir="$xdg_global_dir"
174 kde_dir="$kde_global_dir"
175 gnome_dir="$gnome_global_dir"
176 my_umask=022
177 my_chmod=0644
178 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then
179 exit_failure_operation_impossible "No writable system menu directory found."
180 fi
181 fi
182
183 if [ -z "$menu_file" ] ; then
184 # Work around for SUSE/gnome 2.12 to pick up new ~/.local/share/applicat ions
185 save_umask=`umask`
186 umask $my_umask
187
188 mkdir -p $xdg_dir
189 touch $xdg_dir/@NAME@-dummy.menu
190
191 umask $save_umask
192 return
193 fi
194
195 if [ $action = "install" -a -f "/etc/xdg/menus/gnome-applications.menu" ] ; then
196 # Work around for Debian Gnome
197 gnome_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/gnome-a pplications-merged^'`
198 if [ ! -e "$gnome_xdg_dir" ] ; then
199 DEBUG 1 "Debian Workaround: Link '$xdg_dir' to '$gnome_xdg_dir'"
200 mkdir -p `dirname "$gnome_xdg_dir"`
201 eval 'ln -s "applications-merged" "$gnome_xdg_dir"'$xdg_redirect_out put
202 fi
203 fi
204 if [ $action = "install" -a -f "/etc/mandrake-release" ] ; then
205 # Work around for Mandriva 2006
206 mandrake_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/appl ications-mdk-merged^'`
207 if [ ! -e "$mandrake_xdg_dir" ] ; then
208 DEBUG 1 "Mandriva Workaround: Link '$xdg_dir' to '$mandrake_xdg_dir' "
209 mkdir -p `dirname "$mandrake_xdg_dir"`
210 eval 'ln -s "applications-merged" "$mandrake_xdg_dir"'$xdg_redirect_ output
211 fi
212 fi
213 if [ $action = "install" -a x"$mode" = x"user" -a -d "/etc/xdg/menus/kde-app lications-merged" ] ; then
214 # Work around for Fedora Core 5 + patched KDE
215 kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-appli cations-merged^'`
216 if [ ! -e "$kde_xdg_dir" ] ; then
217 DEBUG 1 "Fedora Workaround: Link '$xdg_dir' to '$kde_xdg_dir'"
218 mkdir -p `dirname "$kde_xdg_dir"`
219 eval 'ln -s "applications-merged" "$kde_xdg_dir"'$xdg_redirect_outpu t
220 fi
221 fi
222 if [ $action = "install" -a x"$mode" = x"system" -a -d "/etc/xdg/menus/kde-a pplications-merged" -a ! -d "/etc/xdg/menus/applications-merged" ] ; then
223 # Work around for Kubuntu 6.06
224 kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-appli cations-merged^'`
225 DEBUG 1 "Kubuntu Workaround: Link '$xdg_dir' to 'kde-applications-merged '"
226 eval 'ln -s "kde-applications-merged" "$xdg_dir"'$xdg_redirect_output
227 fi
228
229 orig_menu_file=$xdg_dir/$menu_file
230
231 DEBUG 1 "Updating $orig_menu_file ($action)"
232
233 test "${TMPDIR+set}" = set || TMPDIR=/tmp
234 tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX`
235 orig_desktop_files=
236 if [ -r "$orig_menu_file" ] ; then
237 awk '
238 # List all files within <Filename> tags
239 BEGIN {
240 RS="<"
241 }
242 /^Filename/ {
243 if (match($0,/>/)) {
244 print substr($0,RSTART+1)
245 }
246 }' $orig_menu_file > $tmpfile
247 fi
248
249 orig_desktop_files=`cat $tmpfile`
250 new_desktop_files=
251 if [ $action = "install" ] ; then
252 for desktop_file in $desktop_files; do
253 basefile=`basename $desktop_file`
254 if ! grep '^'$basefile'$' $tmpfile > /dev/null 2> /dev/null ; then
255 # Append
256 echo "$basefile" >> $tmpfile
257 fi
258 done
259 new_desktop_files=`cat $tmpfile`
260 fi
261 if [ $action = "uninstall" ] ; then
262 echo > $tmpfile
263 for desktop_file in $desktop_files; do
264 echo "$desktop_file" >> $tmpfile
265 done
266 # Files to uninstall are listed in $tmpfile
267 # Existing files are in $orig_desktop_files
268 for desktop_file in $orig_desktop_files; do
269 if ! grep '^'$desktop_file'$' $tmpfile > /dev/null 2> /dev/null; the n
270 # Keep this file, it's not in the uninstall list
271 new_desktop_files="$new_desktop_files $desktop_file"
272 fi
273 done
274 fi
275 rm -f "$tmpfile"
276
277 DEBUG 3 "Files to list in $menu_file: $new_desktop_files"
278
279 if [ -n "$new_desktop_files" ] ; then
280 # Install/update
281 test "${TMPDIR+set}" = set || TMPDIR=/tmp
282 tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX`
283 (
284 echo '<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"'
285 echo ' "http://www.freedesktop.org/standards/menu-spec/menu-1.0.d td">'
286 echo '<!-- Do not edit manually - generated and managed by @NAME@ -- >'
287 echo '<Menu>'
288 echo ' <Name>Applications</Name>'
289
290 for desktop_file in $directory_files; do
291 basefile=`basename $desktop_file`
292 basefilename=`echo "$basefile"|cut -d '.' -f 1`
293 echo "<Menu>"
294 echo " <Name>$basefilename</Name>"
295 echo " <Directory>$basefile</Directory>"
296 done
297
298 echo " <Include>"
299 for desktop_file in $new_desktop_files; do
300 echo " <Filename>$desktop_file</Filename>"
301 done
302 echo " </Include>"
303
304 for desktop_file in $directory_files; do
305 echo "</Menu>"
306 done
307
308 echo '</Menu>'
309 ) > $tmpfile
310 chmod $my_chmod $tmpfile
311
312 save_umask=`umask`
313 umask $my_umask
314
315 mkdir -p $xdg_dir
316 eval 'cp $tmpfile $xdg_dir/$menu_file'$xdg_redirect_output
317
318 umask $save_umask
319 rm -f "$tmpfile"
320 else
321 # Uninstall
322 rm -f $xdg_dir/$menu_file
323 fi
324
325 # Uninstall .directory files only if no longer referenced
326 if [ $action = "uninstall" ] ; then
327 test "${TMPDIR+set}" = set || TMPDIR=/tmp
328 tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX`
329 for menu_file in $xdg_dir/*; do
330 if grep 'generated and managed by @NAME@' $menu_file > /dev/null 2> /dev/null; then
331 awk '
332 # List all files within <Directory> tags
333 BEGIN {
334 RS="<"
335 }
336 /^Directory/ {
337 if (match($0,/>/)) {
338 print substr($0,RSTART+1)
339 }
340 }' $menu_file >> $tmpfile
341 fi
342 done
343 orig_directory_files="$directory_files"
344 directory_files=
345 for desktop_file in $orig_directory_files; do
346 if ! grep '^'$desktop_file'$' $tmpfile > /dev/null 2> /dev/null; the n
347 # No longer in use, safe to delete
348 directory_files="$directory_files $desktop_file"
349 fi
350 done
351 rm -f "$tmpfile"
352 fi
353 }
354
355
356 [ x"$1" != x"" ] || exit_failure_syntax
357
358 mode=
359 action=
360 update=yes
361 desktop_files=
362 directory_files=
363
364 case $1 in
365 install)
366 action=install
367 ;;
368
369 uninstall)
370 action=uninstall
371 ;;
372
373 forceupdate)
374 action=forceupdate
375 ;;
376
377 *)
378 exit_failure_syntax "unknown command '$1'"
379 ;;
380 esac
381
382 shift
383
384 vendor=true
385 while [ $# -gt 0 ] ; do
386 parm="$1"
387 shift
388
389 case "$parm" in
390 --noupdate)
391 update=no
392 ;;
393
394 --mode)
395 if [ -z "$1" ] ; then
396 exit_failure_syntax "mode argument missing for --mode"
397 fi
398 case "$1" in
399 user)
400 mode="user"
401 ;;
402
403 system)
404 mode="system"
405 ;;
406
407 *)
408 exit_failure_syntax "unknown mode '$1'"
409 ;;
410 esac
411 shift
412 ;;
413
414 --novendor)
415 vendor=false
416 ;;
417
418 -*)
419 exit_failure_syntax "unexpected option '$parm'"
420 ;;
421
422 *)
423 if [ "$action" = "install" ] ; then
424 check_input_file "$parm"
425 fi
426 case "$parm" in
427 *.directory)
428 if [ -n "$desktop_files" ] ; then
429 exit_failure_syntax "'$parm' must preceed any *.desktop file"
430 fi
431 directory_files="$directory_files $parm"
432 ;;
433 *.desktop)
434 desktop_files="$desktop_files $parm"
435 ;;
436 *)
437 exit_failure_syntax "file to $action must be a *.directory or *.de sktop file"
438 ;;
439 esac
440 ;;
441 esac
442 done
443
444 # Shouldn't happen
445 if [ -z "$action" ] ; then
446 exit_failure_syntax "command argument missing"
447 fi
448
449 if [ -n "$XDG_UTILS_INSTALL_MODE" ] ; then
450 if [ "$XDG_UTILS_INSTALL_MODE" = "system" ] ; then
451 mode="system"
452 elif [ "$XDG_UTILS_INSTALL_MODE" = "user" ] ; then
453 mode="user"
454 fi
455 fi
456
457 if [ -z "$mode" ] ; then
458 if [ `whoami` = "root" ] ; then
459 mode="system"
460 else
461 mode="user"
462 fi
463 fi
464
465 if [ x"$action" = x"forceupdate" ] ; then
466 update_desktop_database
467 exit_success
468 fi
469
470 if [ -z "$desktop_files" ] ; then
471 exit_failure_syntax "desktop-file argument missing"
472 fi
473
474 menu_name=
475 for desktop_file in $directory_files; do
476 if [ "$vendor" = "true" -a "$action" = "install" ] ; then
477 check_vendor_prefix "$desktop_file"
478 fi
479
480 basefilename=`basename "$desktop_file"|cut -d '.' -f 1`
481 if [ -z "$menu_name" ] ; then
482 menu_name="$basefilename"
483 else
484 menu_name="$menu_name-$basefilename"
485 fi
486 done
487
488 if [ -n "$menu_name" ] ; then
489 if [ x"$mode" = x"user" ] ; then
490 update_submenu "user-$menu_name.menu"
491 else
492 update_submenu "$menu_name.menu"
493 fi
494 else
495 # Work around for SUSE/gnome 2.12 to pick up new ~/.local/share/applications
496 if [ x"$mode" = x"user" ] ; then
497 update_submenu
498 fi
499 fi
500
501 # Install *.directory files
502
503 xdg_dir_name=desktop-directories
504
505 xdg_user_dir="$XDG_DATA_HOME"
506 [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
507 xdg_user_dir="$xdg_user_dir/$xdg_dir_name"
508
509 xdg_system_dirs="$XDG_DATA_DIRS"
510 [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
511 xdg_global_dir=
512 for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
513 if [ -w $x/$xdg_dir_name ] ; then
514 xdg_global_dir="$x/$xdg_dir_name"
515 break
516 fi
517 done
518
519 DEBUG 3 "Install locations for *.directory files:"
520 DEBUG 3 "xdg_user_dir: $xdg_user_dir"
521 DEBUG 3 "xdg_global_dir: $xdg_global_dir"
522 DEBUG 3 "kde_user_dir: $kde_user_dir"
523 DEBUG 3 "kde_global_dir: $kde_global_dir"
524 DEBUG 3 "gnome_user_dir: $gnome_user_dir"
525 DEBUG 3 "gnome_global_dir: $gnome_global_dir"
526
527 if [ x"$mode" = x"user" ] ; then
528 xdg_dir="$xdg_user_dir"
529 kde_dir="$kde_user_dir"
530 gnome_dir="$gnome_user_dir"
531 my_umask=077
532 else
533 xdg_dir="$xdg_global_dir"
534 kde_dir="$kde_global_dir"
535 gnome_dir="$gnome_global_dir"
536 my_umask=022
537 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then
538 exit_failure_operation_impossible "No writable system menu directory fou nd."
539 fi
540 fi
541
542 for desktop_file in $directory_files; do
543 basefile=`basename $desktop_file`
544
545 DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir"
546
547 case $action in
548 install)
549 save_umask=`umask`
550 umask $my_umask
551
552 for x in $xdg_dir $kde_dir $gnome_dir ; do
553 mkdir -p $x
554 eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output
555 done
556
557 umask $save_umask
558 ;;
559
560 uninstall)
561 for x in $xdg_dir $kde_dir $gnome_dir ; do
562 rm -f $x/$basefile
563 done
564
565 ;;
566 esac
567 done
568
569 # Install *.desktop files
570 xdg_dir_name=applications
571
572 xdg_user_dir="$XDG_DATA_HOME"
573 [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share"
574 xdg_user_dir="$xdg_user_dir/$xdg_dir_name"
575
576 xdg_system_dirs="$XDG_DATA_DIRS"
577 [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/
578 xdg_global_dir=
579 for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do
580 if [ -w $x/$xdg_dir_name ] ; then
581 xdg_global_dir="$x/$xdg_dir_name"
582 break
583 fi
584 done
585
586 kde_user_dir="$HOME/.kde/share/applnk"
587 kde_global_dir="/usr/share/applnk"
588 [ -w $kde_global_dir ] || kde_global_dir=
589
590 gnome_user_dir="$HOME/.gnome/apps"
591 gnome_global_dir="/usr/share/gnome/apps"
592 [ -w $gnome_global_dir ] || gnome_global_dir=
593
594 [ -f /etc/mandriva-release ] && need_mandriva_fix=true
595 [ -n "$need_mandriva_fix" ] && DEBUG 1 "Fixing up .desktop categories (Mandriva work around)"
596
597 DEBUG 3 "Install locations for *.desktop files:"
598 DEBUG 3 "xdg_user_dir: $xdg_user_dir"
599 DEBUG 3 "xdg_global_dir: $xdg_global_dir"
600 DEBUG 3 "kde_user_dir: $kde_user_dir"
601 DEBUG 3 "kde_global_dir: $kde_global_dir"
602 DEBUG 3 "gnome_user_dir: $gnome_user_dir"
603 DEBUG 3 "gnome_global_dir: $gnome_global_dir"
604
605 if [ x"$mode" = x"user" ] ; then
606 xdg_dir="$xdg_user_dir"
607 kde_dir="$kde_user_dir"
608 gnome_dir="$gnome_user_dir"
609 my_umask=077
610 else
611 xdg_dir="$xdg_global_dir"
612 kde_dir="$kde_global_dir"
613 gnome_dir="$gnome_global_dir"
614 my_umask=022
615 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then
616 exit_failure_operation_impossible "No writable system menu directory fou nd."
617 fi
618 fi
619
620 for desktop_file in $desktop_files; do
621 if [ "$vendor" = "true" -a "$action" = "install" ] ; then
622 check_vendor_prefix "$desktop_file"
623 fi
624
625 basefile=`basename $desktop_file`
626
627 DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir"
628
629 case $action in
630 install)
631 save_umask=`umask`
632 umask $my_umask
633
634 for x in $xdg_dir $kde_dir $gnome_dir ; do
635 mkdir -p $x
636 eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output
637 done
638
639 if [ -n "$need_mandriva_fix" ] ; then
640 fixup_mandriva_categories $xdg_dir/$basefile
641 fi
642
643 if [ -f $kde_dir/$basefile ] ; then
644 echo "OnlyShowIn=Old;" >> $kde_dir/$basefile
645 fi
646
647 if [ -f $gnome_dir/$basefile ] ; then
648 echo "OnlyShowIn=Old;" >> $gnome_dir/$basefile
649 fi
650
651 make_lazy_default "$xdg_dir" "$basefile"
652
653 umask $save_umask
654 ;;
655
656 uninstall)
657 for x in $xdg_dir $kde_dir $gnome_dir ; do
658 rm -f $x/$basefile
659 done
660
661 ;;
662 esac
663 done
664
665 if [ x"$update" = x"yes" ] ; then
666 update_desktop_database
667 fi
668
669 exit_success
OLDNEW
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-desktop-menu ('k') | third_party/xdg-utils/scripts/xdg-email » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698