r38579 - /trunk/dh-make-perl/lib/DhMakePerl.pm
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Wed Jun 24 20:51:36 UTC 2009
Author: dmn
Date: Wed Jun 24 20:51:30 2009
New Revision: 38579
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38579
Log:
add backup_file() method
creates a backup copy of the given file if the --backup option is given
Modified:
trunk/dh-make-perl/lib/DhMakePerl.pm
Modified: trunk/dh-make-perl/lib/DhMakePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl.pm?rev=38579&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl.pm Wed Jun 24 20:51:30 2009
@@ -139,6 +139,21 @@
my( $self, $file ) = @_;
catfile( $self->main_file('debian'), $file );
+}
+
+=item backup_file(file_name)
+
+Creates a backup copy of the specified file by adding C<.bak> to its name.
+
+Does nothing unless the C<backups> option is set.
+
+=cut
+
+sub backup_file {
+ my( $self, $file ) = @_;
+
+ copy( $file, "$file.bak" )
+ if $self->cfg->backups;
}
sub run {
More information about the Pkg-perl-cvs-commits
mailing list