[środa, 8 czerwiec 2005], Piotr Roszatycki napisał(a):

> 
> migrate to the debhelper ;-)

It would be too easy ;)

> 
> I could fix the yada, just tell me which binary package generates correct 
> postinst/postrm scripts.

Probably any xfont package except for xfonts-biznet* packages ;-)

I prepared patch (attached), which also fixes some other issues I found:


 +                            push @updatecmds,'update-fonts-alias' 
 +                                  if grep { -f 
"debian/tmp-$pkg/etc/X11/fonts/$_/$pkg.alias" } @fontdirs;
The update-fonts-* commands was called saveral times if a package
contained more than one font directory.


 -                                  . ":Depends=xutils (>= 4.0.2)");
 +                                  . ":Depends=xutils (>> 4.0.3)");
Update dependency info as required by the Policy


 -                                  . ":Conflicts=xbase-clients (<< 4.0)");
Not needed, since xutils has the conflict.

Best Regards,
robert
--- /usr/bin/yada       2005-04-25 18:45:50.000000000 +0200
+++ yada        2005-06-08 19:07:51.000000000 +0200
@@ -2960,6 +2960,7 @@
                         or defined $$par{'doc-base'}
                         or defined $contains{'libs'}
                         or defined $$par{'alternatives'}
+                        or defined $contains{'xfonts'}
                         or defined $$par{'config'}
                         or %pyver
                         or %ucf)
@@ -3218,55 +3219,40 @@
                           grep {-d "$XFONTDIR/$_" && !/^\./} (readdir DIR);
                         closedir DIR;
                         if (@fontdirs) {
-                            my @updatecmds = ('/usr/bin/X11/mkfontdir');
-                            foreach my $f (@fontdirs) {
-                                push @updatecmds,
-                                  '/usr/sbin/update-fonts-alias'
-                                  if
-                                  -f 
"debian/tmp-$pkg/etc/X11/fonts/$f/$pkg.alias";
-                                unshift @updatecmds,
-                                  '/usr/sbin/update-fonts-scale'
-                                  if
-                                  -f 
"debian/tmp-$pkg/etc/X11/fonts/$f/$pkg.scale";
-                            }
+                            my @updatecmds = ('update-fonts-dir');
+                            push @updatecmds,'update-fonts-alias' 
+                                  if grep { -f 
"debian/tmp-$pkg/etc/X11/fonts/$_/$pkg.alias" } @fontdirs;
+                            unshift @updatecmds,'update-fonts-scale' 
+                                  if grep { -f 
"debian/tmp-$pkg/etc/X11/fonts/$_/$pkg.scale" } @fontdirs;
+                            
                             print MAINT "\nfontdirs=\""
                               . join (' ', @fontdirs) . "\""
                               . "\nupdatecmds=\""
                               . join (' ', @updatecmds) . "\"\n"
                               or die;
                             if ($_ eq 'postinst') {
-                                print MAINT "\nfor dir in \$fontdirs; do\n"
+                                print MAINT 
+                                  "\nfor currentdir in \$fontdirs; do\n"
                                   . "    for currentcmd in \$updatecmds; do\n"
-                                  . "        \$currentcmd 
/usr/lib/X11/fonts/\$dir\n"
+                                  . "        \$currentcmd \$currentdir\n"
                                   . "    done\n"
                                   . "done\n"
                                   or die;
                             }
                             if ($_ eq 'postrm') {
                                 print MAINT
-                                  "\nfor currentdir in \$fontdirs; do\n"
-                                  . "    
longdir=/usr/lib/X11/fonts/\$currentdir\n"
-                                  . "    if [ -d \$longdir ]; then\n"
-                                  . "        for file in fonts.dir 
fonts.alias; do\n"
-                                  . "            rm -f \$file\n"
+                                  "\nif [ \"\$1\" != \"upgrade\" ]; then\n"
+                                  . "    for currentdir in \$fontdirs; do\n"
+                                  . "        for currentcmd in \$updatecmds; 
do\n"
+                                  . "            \$currentcmd \$currentdir\n"
                                   . "        done\n"
-                                  . "        if [ \$(find \$longdir| wc -l) 
-eq 1 ]; then\n"
-                                  . "            rmdir -p \$longdir\n"
-                                  . "        else\n"
-                                  . "            for currentcmd in 
\$updatecmds; do\n"
-                                  . "                \$currentcmd \$longdir\n"
-                                  . "            done\n"
-                                  . "        fi\n"
-                                  . "    fi\n"
-                                  . "done\n"
+                                  . "    done\n"
+                                  . "fi\n"
                                   or die;
                             }
                             &add_to_substvars("xfonts:"
                                   . &normalise($pkg)
-                                  . ":Depends=xutils (>= 4.0.2)");
-                            &add_to_substvars("xfonts:"
-                                  . &normalise($pkg)
-                                  . ":Conflicts=xbase-clients (<< 4.0)");
+                                  . ":Depends=xutils (>> 4.0.3)");
                         }
                     }
                     if (defined $script) {

Reply via email to