5 dh_icons - Update Freedesktop icon caches
11 use Debian::Debhelper::Dh_Lib;
15 B<dh_icons> [S<I<debhelper options>>] [B<-n>]
19 dh_icons is a debhelper program that updates Freedesktop icon caches
20 when needed, using the gtk-update-icon-cache program provided by GTK+2.0.
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 F<gtk-update-icon-cache>.
29 =item B<-n>, B<--noscripts>
31 Do not modify maintainer scripts.
37 my $baseicondir="/usr/share/icons";
39 foreach my $package (@{$dh{DOPACKAGES}}) {
40 my $tmp=tmpdir($package);
41 my $icondir="$tmp$baseicondir";
44 opendir(DIRHANDLE, $icondir);
45 while (my $subdir = readdir(DIRHANDLE)) {
46 next if $subdir =~ /^\./;
49 $needs_cache = 1 if -f and (/\.png$/ or /\.svg$/ or /\.jpg$/);
50 }, "$icondir/$subdir" ;
51 push @dirlist, "$baseicondir/$subdir" if $needs_cache;
53 if (@dirlist and ! $dh{NOSCRIPTS}) {
54 my $list=join(" ", @dirlist);
55 autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%");
56 autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%");
65 This program is a part of debhelper.
69 Ross Burton <ross@burtonini.com>
70 Jordi Mallach <jordi@debian.org>
71 Josselin Mouette <joss@debian.org>