5 dh_icons - Update Freedesktop icon caches
11 use Debian::Debhelper::Dh_Lib;
15 B<dh_icons> [S<I<debhelper options>>] [B<-n>]
19 B<dh_icons> is a debhelper program that updates Freedesktop icon caches
20 when needed, using the B<update-icon-caches> program provided by GTK+2.12.
21 Currently this program does not handle installation of the files, though it
22 may do so at a later date. It takes care of adding maintainer script
23 fragments to call B<update-icon-caches>.
29 =item B<-n>, B<--noscripts>
31 Do not modify maintainer scripts.
39 my $baseicondir="/usr/share/icons";
41 foreach my $package (@{$dh{DOPACKAGES}}) {
42 my $tmp=tmpdir($package);
43 my $icondir="$tmp$baseicondir";
46 opendir(DIRHANDLE, $icondir);
47 while (my $subdir = readdir(DIRHANDLE)) {
48 next if $subdir =~ /^\./;
49 next if $subdir eq "gnome";
50 next if $subdir eq "hicolor";
53 $needs_cache = 1 if -f and (/\.png$/ or /\.svg$/ or /\.xpm$/ or /\.icon$/);
54 }, "$icondir/$subdir" ;
55 push @dirlist, "$baseicondir/$subdir" if $needs_cache;
57 if (@dirlist and ! $dh{NOSCRIPTS}) {
58 my $list=join(" ", @dirlist);
59 autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%");
60 autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%");
69 This program is a part of debhelper.
73 Ross Burton <ross@burtonini.com>
74 Jordi Mallach <jordi@debian.org>
75 Josselin Mouette <joss@debian.org>