File: prune.pl

package info (click to toggle)
libdancer-perl 1.3513%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,424 kB
  • sloc: perl: 7,386; xml: 2,139; sh: 54; makefile: 30; sql: 5
file content (33 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl

use warnings;
use strict;

s/(?<="jquery.min.js" => )FILE/\\\&link_jquery/;

print <<'EOT' if /^sub jquery_minified/;
sub link_jquery {
    my $path = shift;

    my $target = '/usr/share/javascript/jquery/jquery.min.js';

    if ( -e $target ) {
        symlink( $target, $path ) or die "symlink($target, $path): $!\n";
    }
    else {
        # fallback to the embedded copy
        jquery_minified($path);
    }
}

EOT

print $_
    if not /^sub write_bg/ .. /^\}/
        and not /^sub write_logo/ .. /\}/
        and not /^sub write_favicon/ .. /\}/
        and not /write_bg/
        and not /write_logo/
        and not /write_favicon/
        and not /code.jquery.com/
        and not /Grab jQuery/;