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 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 F<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 =~ /^\./;
51 $needs_cache = 1 if -f and (/\.png$/ or /\.svg$/ or /\.xpm$/ or /\.icon$/);
52 }, "$icondir/$subdir" ;
53 push @dirlist, "$baseicondir/$subdir" if $needs_cache;
55 if (@dirlist and ! $dh{NOSCRIPTS}) {
56 my $list=join(" ", @dirlist);
57 autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%");
58 autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%");
67 This program is a part of debhelper.
71 Ross Burton <ross@burtonini.com>
72 Jordi Mallach <jordi@debian.org>
73 Josselin Mouette <joss@debian.org>