perl-dbi.patch 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. Index: DBD-SQLite-1.13/Makefile.PL
  2. --- DBD-SQLite-1.13/Makefile.PL.orig 2006-09-08 05:45:13.000000000 +0200
  3. +++ DBD-SQLite-1.13/Makefile.PL 2006-09-19 20:05:27.104172279 +0200
  4. @@ -10,34 +10,6 @@
  5. }
  6. use Config;
  7. use strict;
  8. -eval {
  9. - require DBD::SQLite;
  10. - if ($DBD::SQLite::VERSION < 1.0) {
  11. - print <<EOT;
  12. -
  13. -**** WARNING **** WARNING **** WARNING **** WARNING **** WARNING ****
  14. -
  15. -Your version of DBD::SQLite currently installed ($DBD::SQLite::VERSION) uses
  16. -the old sqlite database format. This version of DBD::SQLite will *NOT*
  17. -open these files, and installing this module may cause problems on your
  18. -system. If this is a live environment you should upgrade with caution.
  19. -
  20. -To upgrade a database, download and install both sqlite 2.x and 3.x from
  21. -http://www.sqlite.org/ and issue:
  22. -
  23. - sqlite OLD.DB .dump | sqlite3 NEW.DB
  24. -
  25. -DBD::SQLite will NOT automatically upgrade a database for you, and using
  26. -this version against an old SQLite database WILL lead to database
  27. -corruption.
  28. -
  29. -EOT
  30. - if (prompt("Continue?", "N") !~ /^y/i) {
  31. - print "Exiting\n";
  32. - exit -1;
  33. - }
  34. - }
  35. -};
  36. # 2005/6/19, by rjray@blackperl.com
  37. #
  38. @@ -111,18 +83,19 @@
  39. my $nlid = $DBI::VERSION > 1.42 ? '' : '-Dno_last_insert_id';
  40. -my $libs = '';
  41. -$libs .= "-L$sqlite_lib " if ($sqlite_lib);
  42. -$libs .= "-lsqlite3 " unless ($force_local);
  43. +my $inc = `pkg-config sqlite3 --cflags-only-I`;
  44. +$inc =~ s/\r?\n$//s;
  45. +my $libs = `pkg-config sqlite3 --libs`;
  46. +$libs =~ s/\r?\n$//s;
  47. WriteMakefile(
  48. 'NAME' => 'DBD::SQLite',
  49. 'VERSION_FROM' => 'lib/DBD/SQLite.pm', # finds $VERSION
  50. 'PREREQ_PM' => {DBI => 1.21}, # e.g., Module::Name => 1.1
  51. 'OBJECT' => ($force_local) ? '$(O_FILES)' : 'SQLite.o dbdimp.o',
  52. - 'INC' => '-I. -I$(DBI_INSTARCH_DIR)' .
  53. + 'INC' => $inc . ' -I. -I$(DBI_INSTARCH_DIR)' .
  54. (($sqlite_inc) ? " -I$sqlite_inc" : ''),
  55. - $libs ? ('LIBS' => $libs) : (),
  56. + 'LIBS' => [ $libs ],
  57. 'OPTIMIZE' => "-O2",
  58. 'DEFINE' => "-DNDEBUG=1 -DSQLITE_PTR_SZ=$Config{ptrsize}" .
  59. ( ($Config{d_usleep} ||
  60. Index: DBD-SQLite-1.13/dbdimp.c
  61. --- DBD-SQLite-1.13/dbdimp.c.orig 2006-09-08 06:50:50.000000000 +0200
  62. +++ DBD-SQLite-1.13/dbdimp.c 2006-09-19 20:03:45.164447005 +0200
  63. @@ -394,14 +394,17 @@
  64. sqlite_trace(3, "Execute returned %d cols\n", DBIc_NUM_FIELDS(imp_sth));
  65. if (DBIc_NUM_FIELDS(imp_sth) == 0) {
  66. + char *defererr = strdup((char*)sqlite3_errmsg(imp_dbh->db));
  67. while ((retval = sqlite3_step(imp_sth->stmt)) != SQLITE_DONE) {
  68. if (retval == SQLITE_ROW) {
  69. continue;
  70. }
  71. sqlite3_finalize(imp_sth->stmt);
  72. - sqlite_error(sth, (imp_xxh_t*)imp_sth, retval, (char*)sqlite3_errmsg(imp_dbh->db));
  73. + sqlite_error(sth, (imp_xxh_t*)imp_sth, retval, defererr);
  74. + free(defererr);
  75. return -5;
  76. }
  77. + free(defererr);
  78. /* warn("Finalize\n"); */
  79. sqlite3_reset(imp_sth->stmt);
  80. imp_sth->nrow = sqlite3_changes(imp_dbh->db);
  81. Index: DBD-SQLite-1.13/dbdimp.h
  82. --- DBD-SQLite-1.13/dbdimp.h.orig 2006-09-08 06:50:50.000000000 +0200
  83. +++ DBD-SQLite-1.13/dbdimp.h 2006-09-19 20:03:45.164783426 +0200
  84. @@ -4,7 +4,7 @@
  85. #define _DBDIMP_H 1
  86. #include "SQLiteXS.h"
  87. -#include "sqliteInt.h"
  88. +#include "sqlite3.h"
  89. /* 30 second timeout by default */
  90. #define SQL_TIMEOUT 30000