rick@seismo.UUCP (Rick Adams) (09/12/84)
if test ! -d cvt echo mkdir cvt mkdir cvt fi echo x - cvt/cvt.active.sh sed 's/^X//' >cvt/cvt.active.sh <<'*-*-END-of-cvt/cvt.active.sh-*-*' X: "convert the active file format over" XL=$1 XS=$2 Xcc cvtactive.c Xa.out $L $S Xmv $L/active $L/oactive Xmv $L/nactive $L/active *-*-END-of-cvt/cvt.active.sh-*-* echo x - cvt/cvt.clean.sh sed 's/^X//' >cvt/cvt.clean.sh <<'*-*-END-of-cvt/cvt.clean.sh-*-*' X: "clean up after 2.10 works cleanly. This tears down the 2.9 structure." X: "The one parameter should be SPOOL" Xif test x$1 = x ; then X echo "Usage: cvt.clean /usr/spool/news" X exit 1 Xfi Xcd $1 Xrm -f .??* Xrm -rf *.* *-*-END-of-cvt/cvt.clean.sh-*-* echo x - cvt/cvt.links.sh sed 's/^X//' >cvt/cvt.links.sh <<'*-*-END-of-cvt/cvt.links.sh-*-*' X: "Convert from B 2.9 to 2.10 spool format, with dots turned into slashes." XL=$1 XS=$2 Xcat $L/active >> xtmp Xed - xtmp << 'X' Xg; ;s; .*;; X1,$s;.*;ln & &/*; X1,$s;\.;/; X1,$s;\.\([^ ]* \);/\1; X1,$s; \(.*\) \(.*\); \2 \1; Xw Xq XX Xcat xtmp | (cd $S ; sh -v) Xrm -f a.out parents xtmp *-*-END-of-cvt/cvt.links.sh-*-* echo x - cvt/cvt.names.sh sed 's/^X//' >cvt/cvt.names.sh <<'*-*-END-of-cvt/cvt.names.sh-*-*' X: change truncated group names to their full length X: not tested on a real 2.9 system Xif test $# -lt 2 Xthen X echo Useage: cvt.names.sh libdir spooldir Xfi Xecho Expect some errors about missing directories Xcd $2 Xmv fa/laser-lover fa/laser-lovers Xmv net/announce/n net/announce/newusers Xmv net/astro/expe net/astro/expert Xmv net/games/rogu net/games/rogue Xmv net/games/triv net/games/trivia Xmv net/games/vide net/games/video Xmv net/lang/pasca net/lang/pascal Xmv net/lang/prolo net/lang/prolog Xmv net/mail/heade net/mail/headers Xmv net/mail/msggr net/mail/msggroup Xmv net/micro/appl net/micro/apple Xmv net/micro/atar net/micro/atari Xmv net/micro/trs- net/micro/trs-80 Xmv net/music/clas net/music/classical Xmv net/news/confi net/news/config Xmv net/news/newsi net/news/newsite Xmv net/nlang/celt net/nlang/celts Xmv net/nlang/gree net/nlang/greek Xmv net/rec/skydiv net/rec/skydive Xmv net/religion/j net/religion/jewish Xmv net/sport/base net/sport/baseball Xmv net/sport/foot net/sport/football Xmv net/sport/hock net/sport/hockey Xmv net/sport/hoop net/sport/hoops Xmv net/unix-wizar net/unix-wizards Xmv net/works/apol net/works/apollo X Xcd $1 Xsed 's/^fa.laser-lover /fa.laser-lovers / Xs/^net.announce.n /net.announce.newusers / Xs/^net.astro.expe /net.astro.expert / Xs/^net.games.rogu /net.games.rogue / Xs/^net.games.triv /net.games.trivia / Xs/^net.games.vide /net.games.video / Xs/^net.lang.pasca /net.lang.pascal / Xs/^net.lang.prolo /net.lang.prolog / Xs/^net.mail.heade /net.mail.headers / Xs/^net.mail.msggr /net.mail.msggroup / Xs/^net.micro.appl /net.micro.apple / Xs/^net.micro.atar /net.micro.atari / Xs/^net.micro.trs- /net.micro.trs-80 / Xs/^net.music.clas /net.music.classical / Xs/^net.news.confi /net.news.config / Xs/^net.news.newsi /net.news.newsite / Xs/^net.nlang.celt /net.nlang.celts / Xs/^net.nlang.gree /net.nlang.greek / Xs/^net.rec.skydiv /net.rec.skydive / Xs/^net.religion.j /net.religion.jewish / Xs/^net.sport.base /net.sport.baseball / Xs/^net.sport.foot /net.sport.football / Xs/^net.sport.hock /net.sport.hockey / Xs/^net.sport.hoop /net.sport.hoops / Xs/^net.unix-wizar /net.unix-wizards / Xs/^net.works.apol /net.works.apollo /' active > nactive Xmv active oactive Xmv nactive active *-*-END-of-cvt/cvt.names.sh-*-* echo x - cvt/cvtactive.c sed 's/^X//' >cvt/cvtactive.c <<'*-*-END-of-cvt/cvtactive.c-*-*' X/* X * Convert from the dot files and one field active file to a X * two field active file. X */ X#include <stdio.h> X#include <sys/types.h> X#include <sys/stat.h> X Xchar *LIB, *SPOOL; Xchar oactive[100], nactive[100]; Xchar dotfile[100]; Xchar ng[100]; XFILE *ofd, *nfd; X Xstruct stat sbuf; X Xmain(argc, argv) Xchar **argv; X{ X register char *p; X X if (argc != 3) { X printf("Usage: cvtdot LIB SPOOL\n"); X exit(1); X } X X LIB = argv[1]; X SPOOL = argv[2]; X X sprintf(oactive, "%s/%s", LIB, "active"); X sprintf(nactive, "%s/%s", LIB, "nactive"); X ofd = fopen(oactive, "r"); X if (ofd == NULL) { X fprintf(stderr, "Cannot open %s\n", oactive); X exit(1); X } X nfd = fopen(nactive, "w"); X if (nfd == NULL) { X fprintf(stderr, "Cannot create %s\n", nactive); X exit(1); X } X X while (fgets(ng, sizeof ng, ofd) != NULL) { X for (p=ng; *p!='\n'; p++) X ; X *p = 0; X sprintf(dotfile, "%s/.%s", SPOOL, ng); X stat(dotfile, &sbuf); X fprintf(nfd, "%s %05ld\n", ng, sbuf.st_size); X } X fclose(ofd); X fclose(nfd); X} *-*-END-of-cvt/cvtactive.c-*-* exit