[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New make is breaking several packages



Daniel Schepler wrote:
> One way to fix this is to rewrite the above as:
> 
> perl -e 'my $lines=""; my $count=0; '\
>         '         while (<>) { '\
>         '            next if /^\d+$/; '\
>         '            $lines.=$_; $count++; '\
> ...
>         '         print "$count\n$lines";' \
>                  < fonts.scale \
>                  > `pwd`/debian/gsfonts-x11/etc/X11/fonts/Type1/[longline]
> That way the shell sees a list of strings with no spaces between them, so it 
> concatenates all of them together before passing them to perl.

However, there has to be exactly one tab and no more before the
continuation lines if you do this, resulting in horrible changes like
this if the continued part is further indented:

-            grep -v Client/ConfModule | xargs perl -i.bak -ne '        \
-                       print $$_."# This file was preprocessed, do not edit!\n" \
-                               if m:^#!/usr/bin/perl:;                 \
-                       $$cutting=1 if /^=/;                            \
-                       $$cutting="" if /^=cut/;                        \
-                       next if /use lib/;                              \
-                       next if $$cutting || /^(=|\s*#)/;               \
-                       print $$_                                       \
-               '
+            grep -v Client/ConfModule | xargs perl -i.bak -ne          \
+       '               print $$_."# This file was preprocessed, do not edit!\n"'\
+       '                       if m:^#!/usr/bin/perl:;                 '\
+       '               $$cutting=1 if /^=/;                            '\
+       '               $$cutting="" if /^=cut/;                        '\
+       '               next if /use lib/;                              '\
+       '               next if $$cutting || /^(=|\s*#)/;               '\
+       '               print $$_                

Oh well, there are other ways; I put the perl script into a make variable
instead, since Make still has sane multiline quoting rules for those.

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: