Alt-App-makepatch
view release on metacpan or search on metacpan
script/makepatch view on Meta::CPAN
-exclude-rcs exclude version control files for RCS
-exclude-cvs exclude version control files for CVS
-exclude-sccs exclude version control files for SCCS
-ignore-cvs-keywords ignore diffs in CVS keyword data (same as RCS)
-ignore-rcs-keywords ignore diffs in RCS keyword data (same as CVS)
-extract PAT=RULE define an archive extraction rule
-[no]recurse recurse through directories (default)
-verbose verbose progress information
-quiet no progress information
-help this message
EoU
die ("Not okay 99\n") if $opt_test;
exit $exit if defined $exit && $exit != 0;
}
sub app_usage_filelist ($) {
my ($exit) = @_;
print STDERR <<EoU;
This is $my_name version $my_version
Usage: $0 -filelist [ options ] [ -manifest ] file
Filelist options:
-[file]list extract filenames from manifest file
-prefix XXX add a prefix to these filenames
-nosort do not sort manifest entries
-man[ifest] file list of files
-exclude pat exclude files according to wildcard pattern
-exclude-regex pat exclude files and dirs matching regex pattern
-exclude-vc exclude version control files (RCS, CVS, SCCS)
-exclude-rcs exclude version control files for RCS
-exclude-cvs exclude version control files for CVS
-exclude-sccs exclude version control files for SCCS
-verbose verbose output (default)
-quiet no verbose output
-help this message
EoU
die ("Not okay 99\n") if $opt_test;
exit $exit if defined $exit && $exit != 0;
}
1;
__END__
################ Documentation ################
=head1 NAME
makepatch - create script to update a source tree
=head1 SYNOPSIS
B<makepatch> [ I<options> ] I<old-src> I<new-src>
=for comment
B<makepatch> B<-filelist> [ I<options> ] I<manifest>
=head1 Introduction
Traditionally, source trees are updated with the B<patch> program,
processing patch information that is generated by the B<diff> program.
Although B<diff> and B<patch> do a very good job at patching file
contents, most versions do not handle creating and deleting files and
directories, and adjusting of file modes and time stamps. Newer
versions of B<diff> and B<patch> seem to be able to create files, and
very new versions of B<patch> can remove files. But that's about it.
Another typical problem is that patch kits are typically downloaded
from the Internet, or transmitted via electronic mail. It is often
desirable to verify the correctness of a patch kit before even
attempting to apply it.
The B<makepatch> package is designed to overcome these limitations.
=head1 DESCRIPTION
The B<makepatch> package contains two Perl programs:
B<makepatch> and B<applypatch>.
B<makepatch> will generate a patch kit from two source trees. It
traverses the source directory and runs a B<diff> on each pair of
corresponding files, accumulating the output into a patch kit. It
knows about the conventions for patch kits: if a file named
C<patchlevel.h> exists, it is handled first, so B<patch> can check the
version of the source tree. Also, to deal with the non-perfect
versions of B<patch> that are in use, it supplies "C<Index:>" and
"C<Prereq:>" lines, so B<patch> can correctly locate the files to
patch, and it relocates the patch to the current directory to avoid
problems with creating new files.
The list of files can be specified in a so called B<MANIFEST> file,
but it can also be generated by recursively traversing the source
tree. Files can be excluded using shell style wildcards and Perl regex
patterns.
But that is not it! B<makepatch> also inserts some additional
information in the patch kit for use by the B<applypatch> program.
It is important to emphasize that the generated patch kit is still
valid input for B<patch>. When used with B<patch>, there are no
verifications and problems may arise when new files need to be
created. B<makepatch> prepends a small shell script in front of the
patch kit that creates the necessary files and directories for the
patch process. If you can not run B<applypatch> for some reason, you
can run the patch kit I<as a shell script> to prepare the source
directory for the patching process.
The B<applypatch> program will do the following:
=over 4
=item *
It will extensively verify that the patch kit is complete and not
corrupted during transfer.
=item *
It will apply some heuristics to verify that the directory in
which the patch will be applied does indeed contain the expected
( run in 0.480 second using v1.01-cache-2.11-cpan-39bf76dae61 )