DBI install failed

Discussion in 'Perl Misc' started by Chris, May 26, 2006.

  1. Chris

    Chris Guest

    Hi all,

    Apologies for the long posting, but the details are important (I
    think :) )...

    I'm trying to install the DBI module via cpan and it all goes fine apart
    from one minor test. To me there seems to be a problem with the test,
    but before I file it as a bug would you confirm or deny my thoughts?
    TIA

    The test is no. 228 in t/10examp and the output is:

    ok 224 - The object isa DBI::st
    ok 225
    ok 226 # skip # dump_results test skipped: unable to
    open /homes/chris/tmp/dumpcsr.tst: Permission d
    enied
    #
    ok 227 # skip # dump_results test skipped: unable to
    open /homes/chris/tmp/dumpcsr.tst: Permission d
    enied
    #
    not ok 228 - Remove /homes/chris/tmp/dumpcsr.tst
    ok 229 - Actually gone


    The code snippet which generates the error is in this block:

    {
    # dump_results;
    my $sth = $dbh->prepare($std_sql);

    isa_ok($sth, "DBI::st");

    if ($haveFileSpec && length(File::Spec->updir)) {
    ok($sth->execute(File::Spec->updir));
    } else {
    ok($sth->execute('../'));
    }

    my $dump_dir = ($ENV{TMP} ||
    $ENV{TEMP} ||
    $ENV{TMPDIR} ||
    $ENV{'SYS$SCRATCH'} ||
    '/tmp');
    my $dump_file = ($haveFileSpec) ?

    File::Spec->catfile($dump_dir, 'dumpcsr.tst')
    :
    "$dump_dir/dumpcsr.tst";
    ($dump_file) = ($dump_file =~ m/^(.*)$/); # untaint

    SKIP: {
    skip "# dump_results test skipped: unable to open
    $dump_file: $!\n", 2 unless (open(
    DUMP_RESULTS, ">$dump_file"));
    ok($sth->dump_results("10", "\n", ",\t",
    \*DUMP_RESULTS));
    close(DUMP_RESULTS);
    ok(-s $dump_file > 0);
    }

    is( unlink( $dump_file ), 1, "Remove $dump_file" ); <-- ERROR
    ok( !-e $dump_file, "Actually gone" );

    }

    It seems that the code fails to create the dump_file which is 'ok', but
    then when it tries to delete it and fails that is 'nok'. My issues are:

    1. If the failure of the file create is ok then it shouldn't try to
    delete it.
    2. My $HOME/tmp permissions are 700 so that's the cause of the problem.
    The test should really check for this.
    3. This is such a minor error that the installation DBI shouldn't fail
    because of it.

    Has anyone else come across this or is this particular to my setup?
    Again TIA
    Chris, May 26, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ulloa
    Replies:
    1
    Views:
    526
    Juha Laiho
    Jul 22, 2004
  2. thomas eric

    dbi install failed

    thomas eric, Dec 14, 2003, in forum: Ruby
    Replies:
    4
    Views:
    148
    thomas eric
    Dec 14, 2003
  3. Jerome Hauss
    Replies:
    0
    Views:
    167
    Jerome Hauss
    Oct 13, 2004
  4. Asby

    Mason, DBI, and DBI::Pg

    Asby, Jul 24, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    176
  5. Tim Haynes
    Replies:
    3
    Views:
    140
    Ron Reidy
    Sep 13, 2003
Loading...

Share This Page