renaming a directory so that supplied patch will work - Unix

This is a discussion on renaming a directory so that supplied patch will work - Unix ; my source distribution resides in a directory called DBIx-DBH-0.09. The person who supplied a patch prepended "old-" and "new-" to his versions of my directories and then created a patch file... what do I need to rename DBIx-DBH-0.09 to in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: renaming a directory so that supplied patch will work

  1. renaming a directory so that supplied patch will work

    my source distribution resides in a directory called DBIx-DBH-0.09. The
    person who supplied a patch prepended "old-" and "new-" to his versions
    of my directories and then created a patch file... what do I need to
    rename DBIx-DBH-0.09 to in order for this patch file to work? I presume
    I then type
    patch -p0 < patchfile
    to apply the patch?

    Mon Mar 6 21:12:44 EST 2006 Mark Stosberg
    * Allow new drivers without needing modification to DBIx:BH
    diff -rN -u old-DBIx-DBH-0.09/ChangeLog new-DBIx-DBH-0.09/ChangeLog
    --- old-DBIx-DBH-0.09/ChangeLog 2006-03-06 21:14:34.000000000 -0500
    +++ new-DBIx-DBH-0.09/ChangeLog 2006-03-06 21:14:34.000000000 -0500
    @@ -1,3 +1,6 @@
    +
    + * Allow new drivers to published and used without modifying DBIx:BH
    (Mark Stosberg)
    +
    2004-12-01 Terrence Brannon

    * changed "vendor" key to driver per Cavaletto
    diff -rN -u old-DBIx-DBH-0.09/lib/DBIx/DBH.pm
    new-DBIx-DBH-0.09/lib/DBIx/DBH.pm
    --- old-DBIx-DBH-0.09/lib/DBIx/DBH.pm 2006-03-06 21:14:34.000000000
    -0500
    +++ new-DBIx-DBH-0.09/lib/DBIx/DBH.pm 2006-03-06 21:14:34.000000000
    -0500
    @@ -9,37 +9,7 @@
    use DBI;
    use Params::Validate qw( :all );

    -#use DBIx:BH::mysql;
    -#use DBIx:BH::Pg;
    -
    -
    -require Exporter;
    -
    -my @driver = qw(mysql Pg Sybase);
    -my $driver = join '|', @driver;
    -my $driver_re = qr/($driver)/ ;
    -
    -our @ISA = qw(Exporter);
    -
    -# Items to export into callers namespace by default. Note: do not
    export
    -# names by default without a very good reason. Use EXPORT_OK instead.
    -# Do not simply export all your public functions/methods/constants.
    -
    -# This allows declaration use DBIx:BH ':all';
    -# If you do not need this, moving things directly into @EXPORT or
    @EXPORT_OK
    -# will save memory.
    -our %EXPORT_TAGS = ( 'all' => [ qw(
    -
    -) ] );
    -
    -our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
    -
    -our @EXPORT = qw(
    -
    -);
    -
    -our $VERSION = '0.09';
    -
    +our $VERSION = '0.10';

    our @attr = qw
    (
    @@ -127,15 +97,9 @@
    my $class = shift;
    my %p = @_;

    - %p = validate( @_, { driver => { callbacks =>
    - { "only valid drivers are @driver" =>
    - sub { $_[0] =~ $driver_re } }}} ) ;
    -
    my $subclass = "DBIx:BH::$p{driver}";
    -
    - my $eval_string = "require $subclass";
    -
    - eval $eval_string;
    + eval "require $subclass";
    + die "unable to require $subclass to support the $p{driver}
    driver.\n" if $@;

    my ($dsn, $user, $pass, $attr) = $subclass->connect_data(@_);
    $attr = dbi_attr($attr, %p);
    @@ -254,16 +218,8 @@

    =head1 ADDING A DRIVER

    -Consists of these steps:
    -
    -=over
    -
    -=item * adding a word to the C<@driver> array in DBH.pm
    -
    -this array consists of whitespace-separated driver names and is used
    to
    -validate drivers in C
    -
    -=item * adding a module to the CBH> hiearchy
    +Simply add a new driver with a name of CBH::$Driver>, where
    +C<$Driver> is a valid DBI driver name.

    =back


  2. Re: renaming a directory so that supplied patch will work

    just to answer my own question. I was quite easy. Just create 2
    replicas of the directory DBIx-DBH with "old-" and "new-" prepended and
    then apply the patch in the directory above them.


+ Reply to Thread