From: zacheiss Date: Sun, 10 Sep 2000 02:53:27 +0000 (+0000) Subject: Changes to members.pc to make it build again, and Makefile.in fixes to X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/462ff7050ae835b82e7f08765f6d5db51a137992 Changes to members.pc to make it build again, and Makefile.in fixes to actually build it. --- diff --git a/dbck/Makefile.in b/dbck/Makefile.in index 38eee4b3..33b27d77 100644 --- a/dbck/Makefile.in +++ b/dbck/Makefile.in @@ -25,11 +25,13 @@ SRCTOP=@top_srcdir@ BUILDTOP=.. mrbindir=@mrbindir@ -OBJS=dbck.o fix.o phase1.o phase2.o phase3.o phase4.o +DBCK_OBJS=dbck.o fix.o phase1.o phase2.o phase3.o phase4.o +MEMBERS_OBJS=members.o +OBJS= $(DBCK_OBJS) $(MEMBERS_OBJS) -CFILES=dbck.c fix.c phase1.c phase2.c phase3.c phase4.c +CFILES=dbck.c fix.c phase1.c phase2.c phase3.c phase4.c members.c -TARGET=dbck +TARGET=dbck members .SUFFIXES: .pc @@ -51,6 +53,15 @@ depend: $(CFILES) install: $(INSTALL_PROGRAM) dbck $(mrbindir) + $(INSTALL_PROGRAM) members $(mrbindir) + +dbck: $(DBCK_OBJS) $(MR_LIBDEP) + $(CC) -o $@ $(LDFLAGS) $(DBCK_OBJS) $(LIBS) + +members: members.o $(MR_LIBDEP) + $(CC) -o $@ $(LDFLAGS) members.o $(LIBS) + + + + -$(TARGET): $(OBJS) $(MR_LIBDEP) - $(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) diff --git a/dbck/members.pc b/dbck/members.pc index 2cfdf027..1655f3c6 100644 --- a/dbck/members.pc +++ b/dbck/members.pc @@ -45,6 +45,7 @@ struct hash *lists, *members; void fix_member(), display_member(); int debug = 0, records = 0; +char *db = "moira/moira"; main(argc, argv) int argc; @@ -58,7 +59,7 @@ char **argv; #endif DEBUG /* ingres sms */ - EXEC SQL CONNECT moira; + EXEC SQL CONNECT :db; /* begin transaction */ /* range of m is imembers */ /* No equivalent */ @@ -332,8 +333,10 @@ fix_members() * and m.member_type = mtype */ EXEC SQL DELETE FROM imembers WHERE list_id = :list_id AND member_id = :member_id AND member_type = :mtype; - EXEC SQL INQUIRE_SQL(:rowcount = rowcount); - printf(" %d rows deleted\n", rowcount); + rowcount = sqlca.sqlerrd[2]; + if (rowcount > 0) + printf("%d entr%s deleted\n", rowcount, + rowcount == 1 ? "y" : "ies"); #endif FIXERRORS } if (errmis > 0) @@ -484,8 +487,10 @@ int *errmis; EXEC SQL INSERT INTO imembers (list_id, member_id, member_type, ref_count, direct) VALUES (:list_id, :member_id, :mtype, :ref_count, :dflag); - EXEC SQL INQUIRE_SQL(:rowcount = rowcount); - printf(" %d rows added\n", rowcount); + rowcount = sqlca.sqlerrd[2]; + if (rowcount > 0) + printf("%d entr%s added\n", rowcount, + rowcount == 1 ? "y" : "ies"); #endif FIXERRORS continue; } @@ -514,8 +519,10 @@ int *errmis; SET ref_count=ref_count+:ref_count, direct = :dflag WHERE list_id = :list_id AND member_id = :member_id AND member_tpe = :mtype; - EXEC SQL INQUIRE_SQL(:rowcount = rowcount); - printf(" %d rows fixed\n", rowcount); + rowcount = sqlca.sqlerrd[2]; + if (rowcount > 0) + printf("%d entr%s updated\n", rowcount, + rowcount == 1 ? "y" : "ies"); #endif FIXERRORS } }