]> andersk Git - moira.git/commitdiff
Remove unused migrate.qc
authordanw <danw>
Wed, 29 Jan 1997 22:56:42 +0000 (22:56 +0000)
committerdanw <danw>
Wed, 29 Jan 1997 22:56:42 +0000 (22:56 +0000)
Move sync.dc to sync.pc
bsd->ansi string functions

afssync/Imakefile
afssync/migrate.qc [deleted file]
afssync/pt_util-fast.c
afssync/pt_util.c
afssync/ptdump.c
afssync/sync.pc [moved from afssync/sync.dc with 100% similarity]

index 02c72e2e772c576dd2ebaa13acd2af32b03158fc..a6b64cb279a72c7886ac28d71d364c5c56aa9022 100644 (file)
@@ -6,7 +6,7 @@ LIBS= -L../lib -L/usr/athena/lib -lmoira -lcom_err -lkrb -ldes ${DBLIBS}
 
 OBJS= ptutils.o utils.o ubik.o
 SRCS= ptutils.c utils.c ubik.c
-CODE= $(SRCS) migrate.qc sync.dc
+CODE= $(SRCS) sync.pc
 
 AFSDIR = /mit/afsuser
 AFSLIBS=$(AFSDIR)/lib/afs/libprot.a   $(AFSDIR)/lib/afs/libauth.a \
@@ -21,4 +21,3 @@ genutil(pt_util,pt_util.o $(OBJS),,$(AFSLIBS) -L../lib -L/usr/athena/lib -lcom_e
 /* genutil(ptdump,ptdump.o $(OBJS),,) */
 
 sqlfile(sync)
-sqlfile(migrate)
diff --git a/afssync/migrate.qc b/afssync/migrate.qc
deleted file mode 100644 (file)
index db81efc..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/* $Header$ */
-
-#include <stdio.h>
-#include <ctype.h>
-
-
-int ingerr();
-
-main(argc, argv)
-int argc;
-char **argv;
-{
-    int debug = 0;
-    FILE *input = stdin;
-    char buf[1024], junk[129];
-##  int cell, quota, cnt, mach, oquota, id, who;
-##  char name[81], type[9], volume[81], path[129], quotas[33];
-##  char oname[129],otype[9];
-    char **arg = argv, *first_indir(), *second_indir(), *course_indir();
-
-    cnt = 0;
-
-    while (++arg - argv < argc) {
-       if (**arg == '-') {
-           switch ((*arg)[1]) {
-           case 'd':
-               debug = atoi((*arg)[2] ? *arg+2 : *++arg);
-               break;
-           default:
-               fprintf(stderr, "Usage: %s [-d level] [inputfile]\n",
-                       argv[0]);
-               exit(1);
-           }
-       } else {
-           input = fopen(*arg, "r");
-           if (input == NULL) {
-               fprintf(stderr, "Unable to open in put file %s\n", *arg);
-               exit(1);
-           }
-       }
-    }
-
-    if (debug > 4)
-      setenv("ING_SET", "set printqry");
-    setlinebuf(stdout);
-    setlinebuf(stderr);
-
-    if (debug) { printf("Opening database..."); fflush(stdout);}
-    IIseterr(ingerr);
-##  ingres sms
-    if (debug) printf("done.\n");
-
-##  range of f is filesys
-##  range of m is machine
-##  range of q is #quota
-##  retrieve (cell = machine.mach_id) where machine.#name="ATHENA.MIT.EDU"
-##  retrieve (who = users.users_id) where users.login="root"
-
-    while (!feof(input)) {
-       fgets(buf, sizeof(buf), input);
-       if (sscanf(buf, "%s %s %s %s %s %s %s %s %s %s %s %s",
-                  name, type, junk, junk, junk, junk,
-                  quotas, junk, junk, junk, junk, junk) < 12) {
-           fprintf(stderr, "unable to parse line: %s\n", buf);
-           continue;
-       }
-       quota = atoi(quotas);
-       if (!strcmp(type, "HOMEDIR")) {
-           sprintf(path, "/afs/athena.mit.edu/user/%s/%s/%s",
-                   first_indir(name), second_indir(name), name);
-       } else if (!strcmp(type, "COURSE")) {
-           sprintf(path, "/afs/athena.mit.edu/course/%s/%s",
-                   course_indir(name), name);
-       } else if (!strcmp(type, "ACTIVITY")) {
-           sprintf(path, "/afs/athena.mit.edu/activity/%s/%s",
-                   first_indir(name), name);
-       } else if (!strcmp(type, "APROJ")) {
-           sprintf(path, "/afs/athena.mit.edu/astaff/project/%s",
-                   name);
-       } else if (!strcmp(type, "PROJECT")) {
-           sprintf(path, "/afs/athena.mit.edu/project/%s",
-                   name);
-       } else if (!strcmp(type, "AREF")) {
-           sprintf(path, "/afs/athena.mit.edu/astaff/reference/%s",
-                   name);
-       } else if (!strcmp(type, "REF")) {
-           sprintf(path, "/afs/athena.mit.edu/reference/%s",
-                   name);
-       } else if (!strcmp(type, "CONTRIB")) {
-           sprintf(path, "/afs/athena.mit.edu/contrib/%s",
-                   name);
-       } else if (!strcmp(type, "SW")) {
-           sprintf(path, "/afs/athena.mit.edu/software/%s",
-                   name);
-       } else if (!strcmp(type, "SYSTEM")) {
-           sprintf(path, "/afs/athena.mit.edu/system/%s",
-                   name);
-       } else {
-           fprintf(stderr, "Don't know how to deal with type %s\n", type);
-           continue;
-       }
-##     repeat retrieve (otype = f.#type, mach = f.mach_id, oname = f.#name)
-##             where f.label = @name {
-                       strtrim(oname);
-                       printf("changing FS %s (%s, %s on %d) to (AFS, %s)\n",
-                              name, type, oname, mach, path);
-##     }
-##     repeat replace f (phys_id=0, #type="AFS", mach_id=cell,
-##                           #name=@path, modtime=date("now"),
-##                           modby=who, modwith="migrate")
-##             where f.label = @name
-##     repeat retrieve (type = q.#type, id=q.entity_id, oquota=q.#quota)
-##             where q.filsys_id = f.filsys_id and f.label=@name {
-                       printf("removing quota (%d (%s %d) on %s)\n",
-                              oquota, type, id, name);
-##     }
-##     repeat delete q where q.filsys_id = f.filsys_id and f.label=@name
-       printf("adding quota of %d on %s\n", quota, name);
-##     repeat append #quota (filsys_id = f.filsys_id, #type="ANY",
-##                      entity_id=0, phys_id=0,
-##                      #quota=@quota, modtime=date("now"),
-##                      modby=who, modwith="migrate")
-##             where f.label= @name
-       cnt++;
-    }
-
-    if (cnt > 0) {
-##     replace tblstats (updates = tblstats.updates + cnt,
-##                         modtime =  date("now"))
-##         where tblstats.tbl = "filesys"
-##     replace tblstats (updates = tblstats.updates + cnt,
-##                         modtime =  date("now"))
-##         where tblstats.tbl = "quota"
-    }
-
-    if (debug) printf("Done.\n");
-    exit(0);
-}
-
-
-char *first_indir(name)
-char *name;
-{
-    static char buf[10];
-
-    if (islower(name[0]))
-      sprintf(buf, "%c", name[0]);
-    else
-      sprintf(buf, "other");
-    return(buf);
-}
-
-char *second_indir(name)
-char *name;
-{
-    static char buf[10];
-
-    if (islower(name[1]))
-      sprintf(buf, "%c", name[1]);
-    else
-      sprintf(buf, "other");
-    return(buf);
-}
-
-char *course_indir(name)
-char *name;
-{
-    static char buf[10];
-    char *src, *dst;
-
-    dst = buf;
-    for (src = name; *src && isdigit(*src); src++)
-      *dst++ = *src;
-
-    if  (dst == buf)
-      strcpy(buf, "other");
-    else
-      *dst = 0;
-
-    return(buf);
-}
-
-
-ingerr(num)
-int    *num;
-{
-    fprintf(stderr, "An ingres error ocurred, code %d\n", *num);
-    switch (*num) {
-    case 4700:
-       fprintf(stderr, "Deadlock**************************\n");
-       break;
-    default:
-       fprintf(stderr, "Aborting\n");
-       exit(1);
-    }
-    return(0);
-}
index 833c6e727add2d3fc6cded86cb27874cc7a969d2..8b32d43a8d9ce6f264536b7af03e4b0777546f19 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/time.h>
 #include <stdio.h>
 #include <ctype.h>
-#include <strings.h>
+#include <string.h>
 #include <sys/file.h>
 
 #include <afs/param.h>
@@ -169,7 +169,7 @@ char **argv;
     if (ntohl(uh->magic) != UBIK_MAGIC)
        fprintf(stderr, "ptdump: %s: Bad UBIK_MAGIC. Is %x should be %x\n",
                pfile, ntohl(uh->magic), UBIK_MAGIC);
-    bcopy(&uh->version, &uv, sizeof(struct ubik_version));
+    memcpy(&uv, &uh->version, sizeof(struct ubik_version));
     fprintf(stderr, "Ubik Version is: %d.%d\n",
            ntohl(uv.epoch), ntohl(uv.counter));
     if (read(dbase_fd, &prh, sizeof(struct prheader)) < 0) {
index 355c0215e1c3ea59864fd83ffc7332f3b9296dad..85f124ef424eedbe6cdb0f99cb45f574ff5dcd67 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/time.h>
 #include <stdio.h>
 #include <ctype.h>
-#include <strings.h>
+#include <string.h>
 #include <sys/file.h>
 
 #include <afs/param.h>
index 1e443ba2d5f1e59cbf110a2724d6d1276c520817..07742d768a6b130f78d9ed71b6479b30cb3f1156 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/time.h>
 #include <stdio.h>
 #include <ctype.h>
-#include <strings.h>
+#include <string.h>
 #include <sys/file.h>
 #include <lock.h>
 #include <netinet/in.h>
similarity index 100%
rename from afssync/sync.dc
rename to afssync/sync.pc
This page took 0.077766 seconds and 5 git commands to generate.