1 --- dbf2mysql-1.14a.orig/debian/changelog
2 +++ dbf2mysql-1.14a/debian/changelog
4 +dbf2mysql (1.14a-3.1) unstable; urgency=low
6 + * Non-maintainer upload.
7 + * Rebuild against libmysqlclient15-dev; libmysqlclient10-dev hasn't been
8 + dropped yet, but hopefully will be for etch. Closes: #343768.
9 + - debian/patches/05_mysql_real_connect.dpatch: use mysql_real_connect(),
10 + for libmysqlclient15 compatibility.
12 + -- Steve Langasek <vorlon@debian.org> Fri, 17 Feb 2006 16:52:25 -0800
14 +dbf2mysql (1.14a-3) unstable; urgency=low
16 + * Policy updated to 3.6.1
17 + * Patch applied for umlauts.
18 + (closes: #213958,#213959)
19 + * Using dpatch support now for current and past patches.
21 + -- Francesco Paolo Lovergine <frankie@debian.org> Tue, 7 Oct 2003 20:50:07 +0200
23 +dbf2mysql (1.14a-2) unstable; urgency=low
25 + * Replaced mysql_connect with mysql_real_connect, SQLsock isn't used
26 + anymore. (Bart Friederichs).
27 + * README touched to reflect changes.
29 + -- Francesco Paolo Lovergine <frankie@debian.org> Mon, 24 Feb 2003 18:30:26 +0100
31 +dbf2mysql (1.14a-1) unstable; urgency=low
33 + * Patch for FoxPro (Christian Eyrich):
34 + According to Erik Bachmanns XBase File Format Description all M Field
35 + Types (including DBF_MTYPE_FPT) contain the block number as 10 digita
36 + ASCII text. So handling it in DBF_MTYPE_FPT files as long value as the
37 + current versions of dbf2mysql do is wrong. What I experienced with the
38 + FoxPro files here confirm this.
40 + * Patch for MySQL (Bart Friederichs):
41 + I changed the dbf2mysql program to being able to enable the
42 + local-infile option, that is needed for MySQL > 3.23.49 and >4.0.2. I
43 + added an -L option to the command that enables it. It is tested and it
46 + -- Francesco Paolo Lovergine <frankie@debian.org> Tue, 11 Feb 2003 14:47:22 +0100
48 +dbf2mysql (1.14-4) unstable; urgency=low
50 + * Rebuilt to remove /usr/doc link
51 + * Policy standard updated.
53 + -- Francesco Paolo Lovergine <frankie@debian.org> Wed, 11 Dec 2002 15:20:56 +0100
55 +dbf2mysql (1.14-3) unstable; urgency=low
57 + * Maintainer email corrected in control file.
59 + -- Francesco Paolo Lovergine <frankie@debian.org> Mon, 26 Nov 2001 14:11:27 +0100
61 +dbf2mysql (1.14-2) unstable; urgency=low
63 + * New maintainer. (closes: #93897)
65 + -- Francesco Paolo Lovergine <frankie@debian.org> Tue, 20 Nov 2001 12:25:53 +0100
67 +dbf2mysql (1.14-1) unstable; urgency=high
69 + * New upstream version, with support for MEMO fields. Closes: #23719.
70 + * dbf2mysql.c: Open temporary file with O_EXCL.
71 + * debian/dbf2mysql.1: Updated and converted from POD to plain man so
72 + that it can be forwarded upstream.
73 + * Switched to debhelper 3.
74 + * Conforms to Standards version 3.5.6:
75 + * debian/copyright: Added upstream URL.
76 + * debian/rules: Support the `debug' build option.
78 + -- Matej Vela <vela@debian.org> Sun, 18 Nov 2001 21:45:13 +0100
80 +dbf2mysql (1.10d-3) unstable; urgency=high
82 + * Maintainer set to Debian QA Group <packages@qa.debian.org>.
83 + * Corrected the priority from extra to optional in
86 + -- Adrian Bunk <bunk@fs.tum.de> Fri, 31 Aug 2001 23:43:44 +0200
88 +dbf2mysql (1.10d-2.0.1) unstable; urgency=low
90 + * Non-maintainer upload
91 + * recompile against current mysql packages to fix Depends: (closes: #43618)
92 + * Add libmysql-dev to Build-Depends (closes: #78693)
94 + -- Steve Langasek <vorlon@debian.org> Sat, 24 Feb 2001 12:55:00 -0600
96 +dbf2mysql (1.10d-2) unstable; urgency=high
98 + * if not for frozen, then at least for unstable ..
100 + -- Heiko Schlittermann <heiko@lotte.sax.de> Wed, 10 Feb 1999 02:26:53 +0100
102 +dbf2mysql (1.10d-1) frozen unstable; urgency=high
104 + * re-upload, no changes beside including orig.tar.gz
106 + -- Heiko Schlittermann <heiko@lotte.sax.de> Mon, 21 Dec 1998 22:27:22 +0100
108 +dbf2mysql (1.10d-1) frozen unstable contrib; urgency=high
112 + -- Heiko Schlittermann <heiko@lotte.sax.de> Thu, 3 Dec 1998 19:22:25 +0100
114 +dbf2mysql (1.10b-3) stable contrib; urgency=high
116 + * new compiled against the latest mysql libraries
119 + -- Heiko Schlittermann <heiko@lotte.sax.de> Wed, 2 Sep 1998 00:16:19 +0200
121 +dbf2mysql (1.10b-2) contrib; urgency=low
123 + * changed the distribution to only contrib ...
124 + [Do I ever understand this???]
126 + -- Heiko Schlittermann <heiko@lotte.sax.de> Tue, 7 Oct 1997 01:06:43 +0200
128 +dbf2mysql (1.10b-1) unstable contrib; urgency=low
130 + * moved to contrib distribution, since it depends
131 + on non-free mysql (bug ????, Martin Schulze)
133 + -- Heiko Schlittermann <heiko@lotte.sax.de> Mon, 6 Oct 1997 22:38:17 +0200
135 +dbf2mysql (1.10b-0) unstable; urgency=low
137 + * Initial Debian release
140 + -- Heiko Schlittermann <heiko@lotte.sax.de> Fri, 1 Aug 1997 09:56:45 +0200
141 --- dbf2mysql-1.14a.orig/debian/foxpro.diff
142 +++ dbf2mysql-1.14a/debian/foxpro.diff
144 +--- dbf2mysql-1.14-4/dbf.c Sat Jul 8 02:19:51 2000
145 ++++ dbf.c Mon Feb 3 13:47:16 2003
147 + switch(dbh->db_memo)
149 + case DBF_MTYPE_FPT:
150 +- blknum = get_long(dbffield);
152 + case DBF_MTYPE_DBT3:
153 + case DBF_MTYPE_DBT4:
154 + strncpy(fields[t].db_contents, (char *)dbffield, fields[t].db_flen);
155 --- dbf2mysql-1.14a.orig/debian/control
156 +++ dbf2mysql-1.14a/debian/control
161 +Maintainer: Francesco Paolo Lovergine <frankie@debian.org>
162 +Standards-Version: 3.6.1
163 +Build-Depends: debhelper (>= 3), dpatch, libmysqlclient15-dev | libmysqlclient-dev
167 +Depends: ${shlibs:Depends}
168 +Description: xBase <--> MySQL
169 + This program takes an xBase file and sends queries to an MySQL server to
170 + insert it into an MySQL table and vice versa.
171 --- dbf2mysql-1.14a.orig/debian/copyright
172 +++ dbf2mysql-1.14a/debian/copyright
174 +This is Debian's prepackaged version of the dbf2mysql utility.
176 +Upstream sources were obtained from
177 +<http://www.mysql.com/Downloads/Contrib/dbf2mysql-1.14.tar.gz>.
179 +The copyright found in the package README:
181 + Use this piece of software as you want, modify it to suit your needs,
182 + but please leave my name in place ok? :)
186 + Maarten Boekhold <boekhold@cindy.et.tudelft.nl>
187 + Michael Widenius <monty@analytikerna.se>
188 --- dbf2mysql-1.14a.orig/debian/README.diff
189 +++ dbf2mysql-1.14a/debian/README.diff
191 +--- ../../dbf2mysql-1.14/README 2000-07-08 02:08:03.000000000 +0200
192 ++++ /tmp/README 2003-02-24 18:23:49.000000000 +0100
195 + -r Trim trailing and leading whitspaces from CHAR type fields data
197 ++-L Enable LOAD DATA LOCAL INFILE, should be used with MySQL > 3.23.49 and
200 + Rudimentary read-only support for Visual FoxPro, DB III+, and DB IV memo
201 + fields/files has been added.
203 --- dbf2mysql-1.14a.orig/debian/dbf2mysql.1
204 +++ dbf2mysql-1.14a/debian/dbf2mysql.1
206 +.TH DBF2MYSQL 1 "2001-11-18" "Debian Project"
209 +dbf2mysql, mysql2dbf \- convert between xBase and MySQL databases
218 +.IR field [, field ]]
220 +.IR conversion-file ]
222 +.IR old-name = new-name [,\c
223 +.IR old-name = new-name ]]
225 +.IR field [, field ]]
264 +takes an xBase file and sends queries to an MySQL server to insert it
265 +into an MySQL table.
268 +dumps a MySQL table to a dbf file.
273 +Produce some status output.
279 +Even more verbose: produce a progress report.
282 +Translate all field names in the xBase file to lowercase.
285 +Translate all text in the xBase file to uppercase.
288 +Translate all text in the xBase file to lowercase.
291 +Allow NULL fields: 'NOT NULL' will be not added in table creation
294 +.BI -o " field\fR[,\fPfield\fR[,...]]"
295 +List fields to insert into MySQL database. Primary use is to ease
296 +import of complex dbf files where we want only few fields. NOTE:
298 +is processed before substitution
300 +so you have to use dbf field names here.
302 +.BI -e " conversion-file"
303 +Specify file for CHAR fields conversion. File format is:
304 +1st line: number of characters to convert (number of lines).
305 +Further lines: <char_to_convert> <char_after_conversion>.
307 +.BI -s " old-name\fR=\fPnew-name\fR[,\fPold-name\fR=\fPnew-name\fR[,...]]"
308 +Takes a list of field name/new field name pairs. Primary use is to
309 +avoid conflicts between field names and MySQL reserved keywords. When
310 +the new field name is empty, the field is skipped in both the CREATE
311 +clause and the INSERT clauses, i.e. it will not be present in the MySQL
315 +-s ORDER=HORDER,REMARKS=,STAT1=STATUS1
318 +.BI -i " field\fR[,\fPfield\fR[,...]]"
319 +List fields to be indexed. MySQL field names should be used here.
322 +Select the database to insert into. Default is 'test'.
325 +Select the table to insert into. Default is 'test'.
328 +Create table if one doesn't exist already. If the table already exists,
329 +drop it and build a new one. The default is to insert all data into the
332 +is specified, no records will be inserted.
335 +Select the primary key. You have to give the exact field name.
338 +Select the host to insert into. Untested.
341 +Fixed length records. (By default CHAR is saved as VARCHAR.)
345 +"Quick" mode. Inserts data via temporary file using 'LOAD DATA INFILE'
346 +MySQL statement. This increased insertion speed on my PC 2-2.5 times.
347 +Also note that during whole 'LOAD DATA' affected table is locked.
350 +Specify custom query to use.
353 +Trim trailing and leading whitespace from CHAR type fields data.
356 +Start each table with _rec and _timestamp fields.
359 +Specify password on the MySQL server.
362 +Specify user on the MySQL server.
365 +can't write MEMO files at this time.
367 +Possibly incorrect field lengths for REAL numbers.
370 +Originally written by Maarten Boekhold <boekhold@cindy.et.tudelft.nl>,
373 +Patched for MySQL by Michael Widenius <monty@analytikerna.se>,
376 +Manual page written for Debian GNU/Linux from README by
377 +Heiko Schlittermann <heiko@lotte.sax.de>, Aug 1997; updated by
378 +Matej Vela <vela@debian.org>, Nov 2001.
381 +Use this piece of software as you want, modify it to suit your needs,
382 +but please leave my name in place ok? :)
385 +The authors do not accept any responsibility for possible damage you get
386 +as result of using this program.
387 --- dbf2mysql-1.14a.orig/debian/mysql.diff
388 +++ dbf2mysql-1.14a/debian/mysql.diff
390 +--- ../../dbf2mysql-1.14/dbf2mysql.c 2002-12-19 10:34:13.000000000 +0100
391 ++++ /tmp/dbf2mysql.c 2003-02-24 18:23:44.000000000 +0100
393 + Fixxed Quick mode insert for blank Numeric fields
394 + Modified to use -x flag to add _rec and _timestamp fields to start of record.
395 + ( only those lines immediately affect by if(express) (and getopt) )
397 ++ Bart Friederichs <bart@friesoft.nl> feb 2003
398 ++ Added MYSQL_OPT_LOCAL_INFILE to options for compatibility with
399 ++ MySQL >3.23.49 and >4.0.2, new option -L enables it
400 ++ Replaced mysql_connect with mysql_real_connect, SQLsock isn't used anymore
403 +-#include <sys/types.h>
404 +-#include <sys/stat.h>
406 + #include <stdlib.h>
407 + #include <unistd.h>
411 + int verbose=0, upper=0, lower=0, create=0, fieldlow=0, var_chars=1;
413 ++int express=0, enable_local=0;
414 + int null_fields=0, trim=0, quick=0;
418 + printf("dbf2mysql %s\n", VERSION);
419 + printf("usage: dbf2mysql [-h hostname] [-d dbase] [-t table] [-p primary key]\n");
420 + printf(" [-o field[,field]] [-s oldname=newname[,oldname=newname]]\n");
421 +- printf(" [-i field[,field]] [-c] [-f] [-F] [-n] [-r] [-u|-l] \n");
422 ++ printf(" [-i field[,field]] [-c] [-f] [-F] [-n] [-r] [-u|-l] [-L]\n");
423 + printf(" [-v[v]] [-x] [-q] [-P password] [-U user] dbf-file\n");
427 + else /* if specified -q create file for 'LOAD DATA' */
429 + datafile = tempnam ("/tmp", "d2my");
430 +- tempfile = fdopen (open (datafile, O_WRONLY | O_CREAT | O_EXCL,
432 ++ tempfile = fopen (datafile, "wt");
433 + if (tempfile == NULL || datafile == NULL)
435 + fprintf (stderr, "Cannot open file '%s' for writing\n", datafile);
438 + if (mysql_query(SQLsock, query) == -1) {
440 +- "Error sending LOAD DATA INFILE from file '%s'\n", datafile);
441 ++ "Error sending LOAD DATA LOCAL INFILE from file '%s'\n", datafile);
443 + "Detailed report: %s\n",
444 + mysql_error(SQLsock));
446 + int main(int argc, char **argv)
449 +- MYSQL *SQLsock,mysql;
452 + extern char *optarg;
458 +- while ((i = getopt(argc, argv, "xqfFrne:lucvi:h:p:d:t:s:o:U:P:")) != EOF) {
459 ++ while ((i = getopt(argc, argv, "xqLfFrne:lucvi:h:p:d:t:s:o:U:P:")) != EOF) {
462 + pass = (char *)strdup(optarg);
465 + flist = (char *)strdup(optarg);
472 + printf("missing argument!\n");
475 + printf("Number of records: %ld\n", dbh->db_records);
479 + printf("Name\t\t Length\tDisplay\t Type\n");
480 + printf("-------------------------------------\n");
481 +@@ -723,7 +729,20 @@
482 + printf("Making connection to MySQL-server\n");
485 +- if (!(SQLsock = mysql_connect(&mysql,host,user,pass))) {
486 ++ mysql_init(&mysql);
488 ++ if (enable_local == 1) {
490 ++ printf("Setting MySQL option MYSQL_OPT_LOCAL_INFILE\n");
493 ++ if (mysql_options(&mysql, MYSQL_OPT_LOCAL_INFILE, 0)) {
494 ++ printf("Setting option not succeeded.");
499 ++ if (!mysql_real_connect(&mysql,host,user,pass, dbase, 0, NULL,0)) {
500 + fprintf(stderr, "Couldn't get a connection with the ");
501 + fprintf(stderr, "designated host!\n");
502 + fprintf(stderr, "Detailed report: %s\n", mysql_error(&mysql));
503 +@@ -731,23 +750,12 @@
507 +- if (verbose > 2) {
508 +- printf("Selecting database '%s'\n", dbase);
511 +- if ((mysql_select_db(SQLsock, dbase)) == -1) {
512 +- fprintf(stderr, "Couldn't select database %s.\n", dbase);
513 +- fprintf(stderr, "Detailed report: %s\n", mysql_error(SQLsock));
514 +- mysql_close(SQLsock);
518 + /* Substitute field names */
519 + do_onlyfields(flist, dbh);
520 + do_substitute(subarg, dbh);
523 +- if (!check_table(SQLsock, table)) {
524 ++ if (!check_table(&mysql, table)) {
525 + printf("Table does not exist!\n");
528 +@@ -758,30 +766,30 @@
530 + if (!(query = (char *)malloc(12 + strlen(table)))) {
531 + printf("Memory-allocation error in main (drop)!\n");
532 +- mysql_close(SQLsock);
533 ++ mysql_close(&mysql);
538 + sprintf(query, "DROP TABLE %s", table);
539 +- mysql_query(SQLsock, query);
540 ++ mysql_query(&mysql, query);
543 + /* Build a CREATE-clause
545 +- do_create(SQLsock, table, dbh);
546 ++ do_create(&mysql, table, dbh);
549 + /* Build an INSERT-clause
552 +- do_inserts(SQLsock, table, dbh);
553 ++ do_inserts(&mysql, table, dbh);
556 + printf("Closing up....\n");
559 +- mysql_close(SQLsock);
560 ++ mysql_close(&mysql);
564 --- dbf2mysql-1.14a.orig/debian/rules
565 +++ dbf2mysql-1.14a/debian/rules
568 +# Sample debian/rules that uses debhelper.
569 +# This file is public domain software, originally written by Joey Hess.
571 +# Uncomment this to turn on verbose mode.
572 +#export DH_VERBOSE=1
574 +# This is the debhelper compatibility version to use.
578 +ifneq ($(findstring debug,$(DEB_BUILD_OPTIONS)),)
582 +include /usr/share/dpatch/dpatch.make
585 +build-stamp: patch-stamp
590 +# patch <debian/foxpro.diff
591 +# patch <debian/mysql.diff
592 +# patch <debian/README.diff
593 +# patch <debian/u_char.diff
595 + # Add here commands to compile the package.
596 + $(MAKE) CFLAGS="$(CFLAGS)" MYSQLLIB= STRIP=
600 +clean: myclean unpatch
606 + # Add here commands to clean up after the build process.
610 + # Reversing patches
612 +# -patch --reverse <debian/README.diff
613 +# -patch --reverse <debian/mysql.diff
614 +# -patch --reverse <debian/foxpro.diff
615 +# -patch --reverse <debian/u_char.diff
623 + dh_installdirs usr/bin
625 + # Add here commands to install the package into debian/<packagename>
626 + install dbf2mysql mysql2dbf debian/dbf2mysql/usr/bin
628 +# Build architecture-independent files here.
629 +binary-indep: build install
630 +# We have nothing to do by default.
632 +# Build architecture-dependent files here.
633 +binary-arch: build install
637 + dh_installdocs README
640 +# dh_installlogrotate
646 + dh_installman debian/dbf2mysql.1
649 + dh_installchangelogs
650 + dh_link usr/share/man/man1/dbf2mysql.1 usr/share/man/man1/mysql2dbf.1
662 +binary: binary-indep binary-arch
663 +.PHONY: build clean binary-indep binary-arch binary install patch unpatch myclean
664 --- dbf2mysql-1.14a.orig/debian/README.Debian
665 +++ dbf2mysql-1.14a/debian/README.Debian
668 +This release of dbf2mysql adds a couple of unofficial patches.
669 +They are due to Christian Eyrich and Bart Friederichs.
670 +Apparently upstream is no more active, so I forked sources.
672 +I tagged debian release as 1.14a for this reason.
674 +According to Erik Bachmanns XBase File Format Description all M Field
675 +Types (including DBF_MTYPE_FPT) contain the block number as 10 digita
676 +ASCII text. So handling it in DBF_MTYPE_FPT files as long value as the
677 +current versions of dbf2mysql do is wrong. What Chris experienced with the
678 +FoxPro files here confirm this.
680 +Bart changed the dbf2mysql program to being able to enable the
681 +local-infile option, that is needed for MySQL > 3.23.49 and >4.0.2. Bart
682 +also added an -L option to the command that enables it.
683 +It is tested and it works.
685 +-- Francesco P. Lovergine <frankie@debian.org>
686 --- dbf2mysql-1.14a.orig/debian/patches/00list
687 +++ dbf2mysql-1.14a/debian/patches/00list
693 +05_mysql_real_connect
694 --- dbf2mysql-1.14a.orig/debian/patches/foxpro.dpatch
695 +++ dbf2mysql-1.14a/debian/patches/foxpro.dpatch
698 +## foxpro.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
700 +## All lines beginning with `## DP:' are a description of the patch.
701 +## DP: No description.
703 +if [ $# -ne 1 ]; then
704 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
708 +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
709 +patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
712 + -patch) patch $patch_opts -p1 < $0;;
713 + -unpatch) patch $patch_opts -p1 -R < $0;;
715 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
722 +diff -urNad /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/dbf.c dbf2mysql-1.14a/dbf.c
723 +--- /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/dbf.c 2003-10-07 20:40:57.000000000 +0200
724 ++++ dbf2mysql-1.14a/dbf.c 2003-10-07 20:41:29.000000000 +0200
726 + switch(dbh->db_memo)
728 + case DBF_MTYPE_FPT:
729 +- blknum = get_long(dbffield);
731 + case DBF_MTYPE_DBT3:
732 + case DBF_MTYPE_DBT4:
733 + strncpy(fields[t].db_contents, (char *)dbffield, fields[t].db_flen);
734 --- dbf2mysql-1.14a.orig/debian/patches/mysql.dpatch
735 +++ dbf2mysql-1.14a/debian/patches/mysql.dpatch
738 +## mysql.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
740 +## All lines beginning with `## DP:' are a description of the patch.
741 +## DP: No description.
743 +if [ $# -ne 1 ]; then
744 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
748 +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
749 +patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
752 + -patch) patch $patch_opts -p1 < $0;;
753 + -unpatch) patch $patch_opts -p1 -R < $0;;
755 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
762 +diff -urNad /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/dbf2mysql.c dbf2mysql-1.14a/dbf2mysql.c
763 +--- /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/dbf2mysql.c 2003-10-07 20:46:27.000000000 +0200
764 ++++ dbf2mysql-1.14a/dbf2mysql.c 2003-10-07 20:46:55.000000000 +0200
766 + Fixxed Quick mode insert for blank Numeric fields
767 + Modified to use -x flag to add _rec and _timestamp fields to start of record.
768 + ( only those lines immediately affect by if(express) (and getopt) )
770 ++ Bart Friederichs <bart@friesoft.nl> feb 2003
771 ++ Added MYSQL_OPT_LOCAL_INFILE to options for compatibility with
772 ++ MySQL >3.23.49 and >4.0.2, new option -L enables it
773 ++ Replaced mysql_connect with mysql_real_connect, SQLsock isn't used anymore
776 +-#include <sys/types.h>
777 +-#include <sys/stat.h>
779 + #include <stdlib.h>
780 + #include <unistd.h>
784 + int verbose=0, upper=0, lower=0, create=0, fieldlow=0, var_chars=1;
786 ++int express=0, enable_local=0;
787 + int null_fields=0, trim=0, quick=0;
791 + printf("dbf2mysql %s\n", VERSION);
792 + printf("usage: dbf2mysql [-h hostname] [-d dbase] [-t table] [-p primary key]\n");
793 + printf(" [-o field[,field]] [-s oldname=newname[,oldname=newname]]\n");
794 +- printf(" [-i field[,field]] [-c] [-f] [-F] [-n] [-r] [-u|-l] \n");
795 ++ printf(" [-i field[,field]] [-c] [-f] [-F] [-n] [-r] [-u|-l] [-L]\n");
796 + printf(" [-v[v]] [-x] [-q] [-P password] [-U user] dbf-file\n");
800 + else /* if specified -q create file for 'LOAD DATA' */
802 + datafile = tempnam ("/tmp", "d2my");
803 +- tempfile = fdopen (open (datafile, O_WRONLY | O_CREAT | O_EXCL,
805 ++ tempfile = fopen (datafile, "wt");
806 + if (tempfile == NULL || datafile == NULL)
808 + fprintf (stderr, "Cannot open file '%s' for writing\n", datafile);
811 + if (mysql_query(SQLsock, query) == -1) {
813 +- "Error sending LOAD DATA INFILE from file '%s'\n", datafile);
814 ++ "Error sending LOAD DATA LOCAL INFILE from file '%s'\n", datafile);
816 + "Detailed report: %s\n",
817 + mysql_error(SQLsock));
819 + int main(int argc, char **argv)
822 +- MYSQL *SQLsock,mysql;
825 + extern char *optarg;
831 +- while ((i = getopt(argc, argv, "xqfFrne:lucvi:h:p:d:t:s:o:U:P:")) != EOF) {
832 ++ while ((i = getopt(argc, argv, "xqLfFrne:lucvi:h:p:d:t:s:o:U:P:")) != EOF) {
835 + pass = (char *)strdup(optarg);
838 + flist = (char *)strdup(optarg);
845 + printf("missing argument!\n");
848 + printf("Number of records: %ld\n", dbh->db_records);
852 + printf("Name\t\t Length\tDisplay\t Type\n");
853 + printf("-------------------------------------\n");
854 +@@ -723,7 +729,20 @@
855 + printf("Making connection to MySQL-server\n");
858 +- if (!(SQLsock = mysql_connect(&mysql,host,user,pass))) {
859 ++ mysql_init(&mysql);
861 ++ if (enable_local == 1) {
863 ++ printf("Setting MySQL option MYSQL_OPT_LOCAL_INFILE\n");
866 ++ if (mysql_options(&mysql, MYSQL_OPT_LOCAL_INFILE, 0)) {
867 ++ printf("Setting option not succeeded.");
872 ++ if (!mysql_real_connect(&mysql,host,user,pass, dbase, 0, NULL,0)) {
873 + fprintf(stderr, "Couldn't get a connection with the ");
874 + fprintf(stderr, "designated host!\n");
875 + fprintf(stderr, "Detailed report: %s\n", mysql_error(&mysql));
876 +@@ -731,23 +750,12 @@
880 +- if (verbose > 2) {
881 +- printf("Selecting database '%s'\n", dbase);
884 +- if ((mysql_select_db(SQLsock, dbase)) == -1) {
885 +- fprintf(stderr, "Couldn't select database %s.\n", dbase);
886 +- fprintf(stderr, "Detailed report: %s\n", mysql_error(SQLsock));
887 +- mysql_close(SQLsock);
891 + /* Substitute field names */
892 + do_onlyfields(flist, dbh);
893 + do_substitute(subarg, dbh);
896 +- if (!check_table(SQLsock, table)) {
897 ++ if (!check_table(&mysql, table)) {
898 + printf("Table does not exist!\n");
901 +@@ -758,30 +766,30 @@
903 + if (!(query = (char *)malloc(12 + strlen(table)))) {
904 + printf("Memory-allocation error in main (drop)!\n");
905 +- mysql_close(SQLsock);
906 ++ mysql_close(&mysql);
911 + sprintf(query, "DROP TABLE %s", table);
912 +- mysql_query(SQLsock, query);
913 ++ mysql_query(&mysql, query);
916 + /* Build a CREATE-clause
918 +- do_create(SQLsock, table, dbh);
919 ++ do_create(&mysql, table, dbh);
922 + /* Build an INSERT-clause
925 +- do_inserts(SQLsock, table, dbh);
926 ++ do_inserts(&mysql, table, dbh);
929 + printf("Closing up....\n");
932 +- mysql_close(SQLsock);
933 ++ mysql_close(&mysql);
937 --- dbf2mysql-1.14a.orig/debian/patches/README.dpatch
938 +++ dbf2mysql-1.14a/debian/patches/README.dpatch
941 +## README.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
943 +## All lines beginning with `## DP:' are a description of the patch.
944 +## DP: No description.
946 +if [ $# -ne 1 ]; then
947 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
951 +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
952 +patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
955 + -patch) patch $patch_opts -p1 < $0;;
956 + -unpatch) patch $patch_opts -p1 -R < $0;;
958 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
965 +diff -urNad /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/README dbf2mysql-1.14a/README
966 +--- /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/README 2003-10-07 20:48:13.000000000 +0200
967 ++++ dbf2mysql-1.14a/README 2003-10-07 20:48:43.000000000 +0200
970 + -r Trim trailing and leading whitspaces from CHAR type fields data
972 ++-L Enable LOAD DATA LOCAL INFILE, should be used with MySQL > 3.23.49 and
975 + Rudimentary read-only support for Visual FoxPro, DB III+, and DB IV memo
976 + fields/files has been added.
978 --- dbf2mysql-1.14a.orig/debian/patches/u_char.dpatch
979 +++ dbf2mysql-1.14a/debian/patches/u_char.dpatch
982 +## u_char.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
984 +## All lines beginning with `## DP:' are a description of the patch.
985 +## DP: No description.
987 +if [ $# -ne 1 ]; then
988 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
992 +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
993 +patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
996 + -patch) patch $patch_opts -p1 < $0;;
997 + -unpatch) patch $patch_opts -p1 -R < $0;;
999 + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
1006 +diff -urNad /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/dbf.c dbf2mysql-1.14a/dbf.c
1007 +--- /home/frankie/debian/mypkgs/dbf2mysql/dbf2mysql-1.14a/dbf.c 2003-10-07 20:40:57.000000000 +0200
1008 ++++ dbf2mysql-1.14a/dbf.c 2003-10-07 20:48:59.000000000 +0200
1009 +@@ -513,7 +513,7 @@
1014 ++ u_char *end, *sp;
1016 + long long int8val;
1018 +@@ -549,7 +549,7 @@
1020 + switch(fields[t].db_type) {
1021 + case 'C': /* Character data */
1022 +- end = (char *)&dbffield[fields[t].db_flen - 1];
1023 ++ end = &dbffield[fields[t].db_flen - 1];
1024 + i = fields[t].db_flen;
1025 + while (( i > 0) && ((*end < 0x21)/* || (*end > 0x7E)*/)) {
1027 +@@ -659,7 +659,7 @@
1031 +- end = (char *)dbffield;
1033 + i = fields[t].db_flen;
1034 + while (( i > 0) && ((*end < 0x21)/* || (*end > 0x7E)*/)) {
1036 --- dbf2mysql-1.14a.orig/debian/patches/05_mysql_real_connect.dpatch
1037 +++ dbf2mysql-1.14a/debian/patches/05_mysql_real_connect.dpatch
1039 +#! /bin/sh /usr/share/dpatch/dpatch-run
1040 +## 05_mysql_real_connect.dpatch by Steve Langasek <vorlon@debian.org>
1042 +## All lines beginning with `## DP:' are a description of the patch.
1043 +## DP: switch from using mysql_connect to mysql_real_connect, for MySQL 5.0
1044 +## DP: compatibility
1048 +--- dbf2mysql-1.14a.orig/mysql2dbf.c
1049 ++++ dbf2mysql-1.14a/mysql2dbf.c
1052 + int main(int argc, char **argv) {
1054 +- MYSQL *SQLsock,mysql;
1056 + extern int optind;
1057 + extern char *optarg;
1058 + char *query = NULL;
1059 +@@ -148,10 +148,16 @@
1060 + printf("Making connection with mySQL-server\n");
1063 +- if (!(SQLsock = mysql_connect(&mysql,host,user,pass))) {
1064 ++ if (!(SQLsock = mysql_init(NULL))) {
1065 ++ fprintf(stderr, "Couldn't initialize MySQL handle.\n");
1066 ++ close(dbh->db_fd);
1070 ++ if (!mysql_real_connect(SQLsock,host,user,pass,NULL,0,NULL,0)) {
1071 + fprintf(stderr, "Couldn't get a connection with the ");
1072 + fprintf(stderr, "designated host!\n");
1073 +- fprintf(stderr, "Detailed report: %s\n", mysql_error(&mysql));
1074 ++ fprintf(stderr, "Detailed report: %s\n", mysql_error(SQLsock));
1075 + close(dbh->db_fd);
1078 --- dbf2mysql-1.14a.orig/debian/u_char.diff
1079 +++ dbf2mysql-1.14a/debian/u_char.diff
1081 +--- dbf.c~ Sat Jul 8 02:19:51 2000
1082 ++++ dbf.c Thu Sep 19 12:41:49 2002
1083 +@@ -513,7 +513,7 @@
1088 ++ u_char *end, *sp;
1090 + long long int8val;
1092 +@@ -549,7 +549,7 @@
1094 + switch(fields[t].db_type) {
1095 + case 'C': /* Character data */
1096 +- end = (char *)&dbffield[fields[t].db_flen - 1];
1097 ++ end = &dbffield[fields[t].db_flen - 1];
1098 + i = fields[t].db_flen;
1099 + while (( i > 0) && ((*end < 0x21)/* || (*end > 0x7E)*/)) {
1101 +@@ -659,7 +670,7 @@
1105 +- end = (char *)dbffield;
1107 + i = fields[t].db_flen;
1108 + while (( i > 0) && ((*end < 0x21)/* || (*end > 0x7E)*/)) {