⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manifest.pm

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 PM
📖 第 1 页 / 共 2 页
字号:
        push @lines, $_;    }    close M;    return unless $flag;    my $bakbase = $mfile;    $bakbase =~ s/\./_/g if $Is_VMS;  # avoid double dots    rename $mfile, "$bakbase.bak";    warn "Debug: Saving original $mfile as $bakbase.bak\n" if $Debug;    unless (open M, ">$mfile") {        warn "Problem opening $mfile: $!";        return;    }    print M $_ for (@lines);    close M;    return;}# returns an array containing the lines of an external# manifest.skip file, if given, or $DEFAULT_MSKIPsub _include_mskip_file {    my $mskip = shift || $DEFAULT_MSKIP;    unless (-f $mskip) {        warn qq{Included file "$mskip" not found - skipping};        return;    }    local (*M, $_);    unless (open M, $mskip) {        warn "Problem opening $mskip: $!";        return;    }    my @lines = ();    push @lines, "\n#!start included $mskip\n";    push @lines, $_ while <M>;    close M;    push @lines, "#!end included $mskip\n\n";    return @lines;}=item manicopy    manicopy(\%src, $dest_dir);    manicopy(\%src, $dest_dir, $how);Copies the files that are the keys in %src to the $dest_dir.  %src istypically returned by the maniread() function.    manicopy( maniread(), $dest_dir );This function is useful for producing a directory tree identical to the intended distribution tree. $how can be used to specify a different methods of "copying".  Validvalues are C<cp>, which actually copies the files, C<ln> which createshard links, and C<best> which mostly links the files but copies anysymbolic link to make a tree without any symbolic link.  C<cp> is the default.=cutsub manicopy {    my($read,$target,$how)=@_;    croak "manicopy() called without target argument" unless defined $target;    $how ||= 'cp';    require File::Path;    require File::Basename;    $target = VMS::Filespec::unixify($target) if $Is_VMS;    File::Path::mkpath([ $target ],! $Quiet,$Is_VMS ? undef : 0755);    foreach my $file (keys %$read){    	if ($Is_MacOS) {	    if ($file =~ m!:!) { 	   	my $dir = _maccat($target, $file);		$dir =~ s/[^:]+$//;	    	File::Path::mkpath($dir,1,0755);	    }	    cp_if_diff($file, _maccat($target, $file), $how);	} else {	    $file = VMS::Filespec::unixify($file) if $Is_VMS;	    if ($file =~ m!/!) { # Ilya, that hurts, I fear, or maybe not?		my $dir = File::Basename::dirname($file);		$dir = VMS::Filespec::unixify($dir) if $Is_VMS;		File::Path::mkpath(["$target/$dir"],! $Quiet,$Is_VMS ? undef : 0755);	    }	    cp_if_diff($file, "$target/$file", $how);	}    }}sub cp_if_diff {    my($from, $to, $how)=@_;    -f $from or carp "$0: $from not found";    my($diff) = 0;    local(*F,*T);    open(F,"< $from\0") or die "Can't read $from: $!\n";    if (open(T,"< $to\0")) {        local $_;	while (<F>) { $diff++,last if $_ ne <T>; }	$diff++ unless eof(T);	close T;    }    else { $diff++; }    close F;    if ($diff) {	if (-e $to) {	    unlink($to) or confess "unlink $to: $!";	}        STRICT_SWITCH: {	    best($from,$to), last STRICT_SWITCH if $how eq 'best';	    cp($from,$to), last STRICT_SWITCH if $how eq 'cp';	    ln($from,$to), last STRICT_SWITCH if $how eq 'ln';	    croak("ExtUtils::Manifest::cp_if_diff " .		  "called with illegal how argument [$how]. " .		  "Legal values are 'best', 'cp', and 'ln'.");	}    }}sub cp {    my ($srcFile, $dstFile) = @_;    my ($access,$mod) = (stat $srcFile)[8,9];    copy($srcFile,$dstFile);    utime $access, $mod + ($Is_VMS ? 1 : 0), $dstFile;    _manicopy_chmod($srcFile, $dstFile);}sub ln {    my ($srcFile, $dstFile) = @_;    return &cp if $Is_VMS or ($^O eq 'MSWin32' and Win32::IsWin95());    link($srcFile, $dstFile);    unless( _manicopy_chmod($srcFile, $dstFile) ) {        unlink $dstFile;        return;    }    1;}# 1) Strip off all group and world permissions.# 2) Let everyone read it.# 3) If the owner can execute it, everyone can.sub _manicopy_chmod {    my($srcFile, $dstFile) = @_;    my $perm = 0444 | (stat $srcFile)[2] & 0700;    chmod( $perm | ( $perm & 0100 ? 0111 : 0 ), $dstFile );}# Files that are often modified in the distdir.  Don't hard link them.my @Exceptions = qw(MANIFEST META.yml SIGNATURE);sub best {    my ($srcFile, $dstFile) = @_;    my $is_exception = grep $srcFile =~ /$_/, @Exceptions;    if ($is_exception or !$Config{d_link} or -l $srcFile) {	cp($srcFile, $dstFile);    } else {	ln($srcFile, $dstFile) or cp($srcFile, $dstFile);    }}sub _macify {    my($file) = @_;    return $file unless $Is_MacOS;    $file =~ s|^\./||;    if ($file =~ m|/|) {	$file =~ s|/+|:|g;	$file = ":$file";    }    $file;}sub _maccat {    my($f1, $f2) = @_;    return "$f1/$f2" unless $Is_MacOS;    $f1 .= ":$f2";    $f1 =~ s/([^:]:):/$1/g;    return $f1;}sub _unmacify {    my($file) = @_;    return $file unless $Is_MacOS;    $file =~ s|^:||;    $file =~ s|([/ \n])|sprintf("\\%03o", unpack("c", $1))|ge;    $file =~ y|:|/|;    $file;}=item maniadd  maniadd({ $file => $comment, ...});Adds an entry to an existing F<MANIFEST> unless its already there.$file will be normalized (ie. Unixified).  B<UNIMPLEMENTED>=cutsub maniadd {    my($additions) = shift;    _normalize($additions);    _fix_manifest($MANIFEST);    my $manifest = maniread();    my @needed = grep { !exists $manifest->{$_} } keys %$additions;    return 1 unless @needed;    open(MANIFEST, ">>$MANIFEST") or       die "maniadd() could not open $MANIFEST: $!";    foreach my $file (_sort @needed) {        my $comment = $additions->{$file} || '';        printf MANIFEST "%-40s %s\n", $file, $comment;    }    close MANIFEST or die "Error closing $MANIFEST: $!";    return 1;}# Sometimes MANIFESTs are missing a trailing newline.  Fix this.sub _fix_manifest {    my $manifest_file = shift;    open MANIFEST, $MANIFEST or die "Could not open $MANIFEST: $!";    # Yes, we should be using seek(), but I'd like to avoid loading POSIX    # to get SEEK_*    my @manifest = <MANIFEST>;    close MANIFEST;    unless( $manifest[-1] =~ /\n\z/ ) {        open MANIFEST, ">>$MANIFEST" or die "Could not open $MANIFEST: $!";        print MANIFEST "\n";        close MANIFEST;    }}# UNIMPLEMENTEDsub _normalize {    return;}=back=head2 MANIFESTA list of files in the distribution, one file per line.  The MANIFESTalways uses Unix filepath conventions even if you're not on Unix.  Thismeans F<foo/bar> style not F<foo\bar>.Anything between white space and an end of line within a C<MANIFEST>file is considered to be a comment.  Any line beginning with # is alsoa comment.    # this a comment    some/file    some/other/file            comment about some/file=head2 MANIFEST.SKIPThe file MANIFEST.SKIP may contain regular expressions of files thatshould be ignored by mkmanifest() and filecheck(). The regularexpressions should appear one on each line. Blank lines and lineswhich start with C<#> are skipped.  Use C<\#> if you need a regularexpression to start with a C<#>.For example:    # Version control files and dirs.    \bRCS\b    \bCVS\b    ,v$    \B\.svn\b    # Makemaker generated files and dirs.    ^MANIFEST\.    ^Makefile$    ^blib/    ^MakeMaker-\d    # Temp, old and emacs backup files.    ~$    \.old$    ^#.*#$    ^\.#If no MANIFEST.SKIP file is found, a default set of skips will beused, similar to the example above.  If you want nothing skipped,simply make an empty MANIFEST.SKIP file.In one's own MANIFEST.SKIP file, certain directivescan be used to include the contents of other MANIFEST.SKIPfiles. At present two such directives are recognized.=over 4=item #!include_defaultThis inserts the contents of the default MANIFEST.SKIP file=item #!include /Path/to/another/manifest.skipThis inserts the contents of the specified external file=backThe included contents will be inserted into the MANIFEST.SKIPfile in between I<#!start included /path/to/manifest.skip>and I<#!end included /path/to/manifest.skip> markers.The original MANIFEST.SKIP is saved as MANIFEST.SKIP.bak.=head2 EXPORT_OKC<&mkmanifest>, C<&manicheck>, C<&filecheck>, C<&fullcheck>,C<&maniread>, and C<&manicopy> are exportable.=head2 GLOBAL VARIABLESC<$ExtUtils::Manifest::MANIFEST> defaults to C<MANIFEST>. Changing itresults in both a different C<MANIFEST> and a differentC<MANIFEST.SKIP> file. This is useful if you want to maintaindifferent distributions for different audiences (say a user versionand a developer version including RCS).C<$ExtUtils::Manifest::Quiet> defaults to 0. If set to a true value,all functions act silently.C<$ExtUtils::Manifest::Debug> defaults to 0.  If set to a true value,or if PERL_MM_MANIFEST_DEBUG is true, debugging output will beproduced.=head1 DIAGNOSTICSAll diagnostic output is sent to C<STDERR>.=over 4=item C<Not in MANIFEST:> I<file>is reported if a file is found which is not in C<MANIFEST>.=item C<Skipping> I<file>is reported if a file is skipped due to an entry in C<MANIFEST.SKIP>.=item C<No such file:> I<file>is reported if a file mentioned in a C<MANIFEST> file does notexist.=item C<MANIFEST:> I<$!>is reported if C<MANIFEST> could not be opened.=item C<Added to MANIFEST:> I<file>is reported by mkmanifest() if $Verbose is set and a file is addedto MANIFEST. $Verbose is set to 1 by default.=back=head1 ENVIRONMENT=over 4=item B<PERL_MM_MANIFEST_DEBUG>Turns on debugging=back=head1 SEE ALSOL<ExtUtils::MakeMaker> which has handy targets for most of the functionality.=head1 AUTHORAndreas Koenig C<andreas.koenig@anima.de>Maintained by Michael G Schwern C<schwern@pobox.com> within theExtUtils-MakeMaker package and, as a separate CPAN package, byRandy Kobes C<r.kobes@uwinnipeg.ca>.=cut1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -