~ubuntu-branches/ubuntu/quantal/libyaml-libyaml-perl/quantal-security

« back to all changes in this revision

Viewing changes to inc/Module/Install/ManifestSkip.pm

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Krzyżaniak (eloy)
  • Date: 2010-09-24 17:35:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100924173542-7ajsmy5mmt6swpgh
Tags: 0.34-1
* New upstream release
* Update Standards-Version to 3.9.1 (no changes)
* Added me to Uploaders (debian/control) and debian/copyright file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#line 1
 
2
package Module::Install::ManifestSkip;
 
3
use strict;
 
4
use warnings;
 
5
use 5.008003;
 
6
 
 
7
use Module::Install::Base;
 
8
 
 
9
use vars qw($VERSION @ISA);
 
10
BEGIN {
 
11
    $VERSION = '0.14';
 
12
    @ISA     = 'Module::Install::Base';
 
13
}
 
14
 
 
15
my $skip_file = "MANIFEST.SKIP";
 
16
 
 
17
sub manifest_skip {
 
18
    my $self = shift;
 
19
    return unless $self->is_admin;
 
20
 
 
21
    print "manifest_skip\n";
 
22
 
 
23
    my $keepers;
 
24
    if (-e $skip_file) {
 
25
        open IN, $skip_file
 
26
            or die "Can't open $skip_file for input: $!";
 
27
        my $input = do {local $/; <IN>};
 
28
        close IN;
 
29
        if ($input =~ s/(.*?\n)\s*\n.*/$1/s and $input =~ /\S/) {
 
30
            $keepers = $input;
 
31
        }
 
32
    }
 
33
    open OUT, '>', $skip_file
 
34
        or die "Can't open $skip_file for output: $!";;
 
35
 
 
36
    if ($keepers) {
 
37
        print OUT "$keepers\n";
 
38
    }
 
39
 
 
40
    print OUT _skip_files();
 
41
 
 
42
    close OUT;
 
43
 
 
44
    $self->clean_files('MANIFEST');
 
45
}
 
46
 
 
47
sub _skip_files {
 
48
    return <<'...';
 
49
^Makefile$
 
50
^Makefile\.old$
 
51
^pm_to_blib$
 
52
^blib/
 
53
^pod2htm.*
 
54
^MANIFEST\.SKIP$
 
55
^MANIFEST\.bak$
 
56
^\.git/
 
57
^\.gitignore
 
58
^\.gitmodules
 
59
/\.git/
 
60
\.svn/
 
61
^\.vimrc$
 
62
\.sw[op]$
 
63
^core$
 
64
^out$
 
65
^tmon.out$
 
66
^\w$
 
67
^foo.*
 
68
^notes
 
69
^todo
 
70
^ToDo$
 
71
## avoid OS X finder files
 
72
\.DS_Store$
 
73
## skip komodo project files
 
74
\.kpf$
 
75
## ignore emacs and vim backup files
 
76
~$
 
77
...
 
78
}
 
79
 
 
80
1;
 
81
 
 
82
=encoding utf8
 
83
 
 
84
#line 135