Newsgroups: comp.sources.unix From: davison@borland.com (Wayne Davison) Subject: v29i039: trn-3.6 - threaded newsreader based on RN, V3.6, Part02/14 References: <1.814959141.29825@gw.home.vix.com> Sender: unix-sources-moderator@gw.home.vix.com Approved: vixie@gw.home.vix.com Submitted-By: davison@borland.com (Wayne Davison) Posting-Number: Volume 29, Issue 39 Archive-Name: trn-3.6/part02 #!/bin/sh # This is `part02' (part 2 of a multipart archive). # Do not concatenate these parts, unpack them in order with `/bin/sh'. # File `trn-3.6/bits.c' is being continued... # touch -am 1231235999 $$.touch >/dev/null 2>&1 if test ! -f 1231235999 && test -f $$.touch; then shar_touch=touch else shar_touch=: echo echo 'WARNING: not restoring timestamps. Consider getting and' echo "installing GNU \`touch', distributed in GNU File Utilities..." echo fi rm -f 1231235999 $$.touch # if test ! -r _sharseq.tmp; then echo 'Please unpack part 1 first!' exit 1 fi shar_sequence=`cat _sharseq.tmp` if test "$shar_sequence" != 2; then echo "Please unpack part $shar_sequence next!" exit 1 fi if test ! -f _sharnew.tmp; then echo 'x - still skipping trn-3.6/bits.c' else echo 'x - continuing file trn-3.6/bits.c' sed 's/^X//' << 'SHAR_EOF' >> 'trn-3.6/bits.c' && X oneless(ap); X ap->flags = (ap->flags & ~(AF_HAS_RE|AF_YANKBACK|AF_FROMTRUNCED)) X | AF_MISSING|AF_CACHED|AF_THREADED; X} X X/* mark an article as unread, with possible xref chasing */ X Xvoid Xunmark_as_read() X{ X register ARTICLE *ap = article_ptr(art); X onemore(ap); X#ifdef MCHASE X if (ap->xrefs != nullstr && !(ap->flags & AF_MCHASE)) { X ap->flags |= AF_MCHASE; X chase_count++; X } X#endif X} X X/* Mark an article as read in this newsgroup and possibly chase xrefs. X** Don't call this on missing articles. X*/ Xvoid Xset_read(ap) Xregister ARTICLE *ap; X{ X oneless(ap); X if (!olden_days && ap->xrefs != nullstr && !(ap->flags & AF_KCHASE)) { X ap->flags |= AF_KCHASE; X chase_count++; X } X} X X/* temporarily mark article as read. When newsgroup is exited, articles */ X/* will be marked as unread. Called via M command */ X Xvoid Xdelay_unmark(ap) XARTICLE *ap; X{ X if (!(ap->flags & AF_YANKBACK)) { X ap->flags |= AF_YANKBACK; X dmcount++; X } X} X X/* mark article as read. If article is cross referenced to other */ X/* newsgroups, mark them read there also. */ X Xvoid Xmark_as_read() X{ X register ARTICLE *ap = article_ptr(art); X oneless(ap); X if (ap->xrefs != nullstr && !(ap->flags & AF_KCHASE)) { X ap->flags |= AF_KCHASE; X chase_count++; X } X checkcount++; /* get more worried about crashes */ X} X X/* keep firstart pointing at the first unread article */ X Xvoid Xcheck_first(min) XART_NUM min; X{ X if (min < absfirst) X min = absfirst; X if (min < firstart) X firstart = min; X} X X/* bring back articles marked with M */ X Xvoid Xyankback() X{ X register ARTICLE *ap; X X if (dmcount) { /* delayed unmarks pending? */ X if (mode == 't') X sprintf(buf, "Returned %ld Marked article%s.",(long)dmcount, X dmcount == 1 ? nullstr : "s"); X else X#ifdef VERBOSE X printf("\nReturning %ld Marked article%s...\n",(long)dmcount, X dmcount == 1 ? nullstr : "s") FLUSH; X#endif X for (art=absfirst, ap=article_ptr(art); art <= lastart; art++, ap++) { X if ((ap->flags & (AF_YANKBACK|AF_MISSING)) == AF_YANKBACK) { X unmark_as_read(); X if (selected_only) X select_article(ap, 0); X ap->flags &= ~AF_YANKBACK; X } X } X dmcount = 0; X } X} X Xstatic int chase_xref _((ART_NUM,int)); X Xint Xchase_xrefs(until_key) Xbool_int until_key; X{ X register ARTICLE *ap; X register ART_NUM an; X X if (!chase_count) X return 1; X if (until_key) X setspin(SPIN_BACKGROUND); X X for (an = absfirst, ap = article_ptr(an); an <= lastart; an++, ap++) { X if (ap->flags & AF_KCHASE) { X chase_xref(an,TRUE); X ap->flags &= ~AF_KCHASE; X if (!--chase_count) X break; X } X#ifdef MCHASE X if (ap->flags & AF_MCHASE) { X chase_xref(an,TRUE); X ap->flags &= ~AF_MCHASE; X if (!--chase_count) X break; X } X#endif X if (until_key && input_pending()) X return 0; X } X chase_count = 0; X return 1; X} X X/* run down xref list and mark as read or unread */ X X#ifndef DBM_XREFS Xstatic int Xchase_xref(artnum,markread) /* The Xref-line-using version */ XART_NUM artnum; Xint markread; X{ X# ifdef VALIDATE_XREF_SITE X bool valid_xref_site(); X# endif X register char *xartnum; X register ART_NUM x; X char *xref_buf, *curxref; X char tmpbuf[128]; X X if (inbackground()) X spin(10); X else { X if (output_chase_phrase) { X#ifdef VERBOSE X IF(verbose) X fputs("\nChasing xrefs", stdout); X ELSE X#endif X#ifdef TERSE X fputs("\nXrefs", stdout); X#endif X output_chase_phrase = 0; X } X putchar('.'), fflush(stdout); X } X X xref_buf = fetchcache(artnum, XREF_LINE, FILL_CACHE); X if (!xref_buf || !*xref_buf) X return 0; X X xref_buf = savestr(xref_buf); X# ifdef DEBUG X if (debug & DEB_XREF_MARKER) X printf("Xref: %s\n",xref_buf) FLUSH; X# endif X curxref = cpytill(tmpbuf,xref_buf,' ') + 1; X# ifdef VALIDATE_XREF_SITE X if (valid_xref_site(artnum,tmpbuf)) X# endif X { X while (*curxref) { /* for each newsgroup */ X curxref = cpytill(tmpbuf,curxref,' '); X xartnum = index(tmpbuf,':'); X if (!xartnum) X break; X *xartnum++ = '\0'; X if (!(x = atol(xartnum))) X continue; X if (strEQ(tmpbuf,ngname)) {/* is this the current newsgroup? */ X if (x < absfirst || x > lastart) X continue; X if (markread) X oneless(article_ptr(x)); /* take care of old C newses */ X#ifdef MCHASE X else X onemore(article_ptr(x)); X#endif X } else { X if (markread) { X if (addartnum(x,tmpbuf)) X break; X } X# ifdef MCHASE X else X subartnum(x,tmpbuf); X# endif X } X while (*curxref && isspace(*curxref)) X curxref++; X } X } X free(xref_buf); X return 0; X} X X# ifdef VALIDATE_XREF_SITE X/* Make sure the site name on Xref matches what inews thinks the site X * is. Check first against last inews_site. If it matches, fine. X * If not, fetch inews_site from current Path or Relay-Version line and X * check again. This is so that if the new administrator decides X * to change the system name as known to inews, rn will still do X * Xrefs correctly--each article need only match itself to be valid. X */ Xbool Xvalid_xref_site(artnum, site) XART_NUM artnum; Xchar *site; X{ X static char *inews_site = Nullch; X char *sitebuf, *s; X X if (inews_site && strEQ(site,inews_site)) X return TRUE; X X if (inews_site) X free(inews_site); X#ifndef ANCIENT_NEWS X /* Grab the site from the first component of the Path line */ X sitebuf = fetchlines(artnum,PATH_LINE); X if ((s = index(sitebuf, '!')) != Nullch) { X *s = '\0'; X inews_site = savestr(sitebuf); X } X#else /* ANCIENT_NEWS */ X /* Grab the site from the Posting-Version line */ X sitebuf = fetchlines(artnum,RVER_LINE); X if ((s = instr(sitebuf,"; site ",TRUE)) != Nullch) { X char *t = index(s+7, '.'); X if (t) X *t = '\0'; X inews_site = savestr(s+7); X } X#endif /* ANCIENT_NEWS */ X else X inews_site = savestr(nullstr); X free(sitebuf); X X if (strEQ(site,inews_site)) X return TRUE; X X#ifdef DEBUG X if (debug) X printf("Xref not from %s--ignoring\n",inews_site) FLUSH; X#endif X return FALSE; X} X# endif /* VALIDATE_XREF_SITE */ X X#else /* DBM_XREFS */ X Xstatic int Xchase_xref(artnum,markread) /* The DBM version */ XART_NUM artnum; Xint markread; X{ X datum lhs, rhs; X datum fetch(); X register char *idp; X char *ident_buf; X static FILE *hist_file = Nullfp; X long pos; X register char *xartnum; X register ART_NUM x; X char *xref_buf, *curxref; X char tmpbuf[128]; X X if (inbackground()) X spin(10); X else { X if (output_chase_phrase) { X#ifdef VERBOSE X IF(verbose) X fputs("\nChasing xrefs", stdout); X ELSE X#endif X#ifdef TERSE X fputs("\nXrefs", stdout); X#endif X output_chase_phrase = 0; X } X putchar('.'), fflush(stdout); X } X X xref_buf = fetchcache(artnum, NGS_LINE, FILL_CACHE); X if (!xref_buf || !*xref_buf) X return 0; X X xref_buf = safemalloc((MEM_SIZE)BUFSIZ); X if (hist_file == Nullfp) { /* Init. file accesses */ X#ifdef DEBUG X if (debug) X printf("chase_xref: opening files\n"); X#endif X dbminit(filexp(ARTFILE)); X if ((hist_file = fopen(filexp(ARTFILE), "r")) == Nullfp) X return 0; X } X ident_buf = fetchlines(artnum,MESSID_LINE); /* get Message-ID */ X#ifdef DEBUG X if (debug) X printf ("chase_xref: Message-ID: %s\n", ident_buf); X#endif X X if ((idp = index(ident_buf, '@')) != Nullch) { X while (*++idp) /* make message-id case insensitive */ X if (isupper(*idp)) X *idp = tolower(*idp); X } X lhs.dptr = ident_buf; /* look up article by id */ X lhs.dsize = strlen(lhs.dptr) + 1; X rhs = fetch(lhs); /* fetch the record */ X if (rhs.dptr == NULL) /* if null, nothing there */ X goto wild_goose; X bcopy(rhs.dptr,(char*)&pos, 4); X fseek(hist_file, pos, 0); /* datum returned is position in hist file */ X fgets(xref_buf, BUFSIZ, hist_file); X#ifdef DEBUG X if (debug) X printf ("Xref from history: %s\n", xref_buf); X#endif X curxref = cpytill(tmpbuf, xref_buf, '\t') + 1; X curxref = cpytill(tmpbuf, curxref, '\t') + 1; X#ifdef DEBUG X if (debug) X printf ("chase_xref: curxref: %s\n", curxref); X#endif X while (*curxref) { /* for each newsgroup */ X curxref = cpytill(tmpbuf,curxref,' '); X xartnum = index(tmpbuf,'/'); X if (!xartnum) /* probably an old-style Xref */ X break; X *xartnum++ = '\0'; X if (!(x = atol(xartnum))) X continue; X if (strNE(tmpbuf,ngname)) { /* not the current newsgroup? */ X if (markread) { X if (addartnum(x,tmpbuf)) X goto wild_goose; X } X#ifdef MCHASE X else X subartnum(x,tmpbuf); X#endif X } X while (*curxref && isspace(*curxref)) X curxref++; X } X wild_goose: X free(xref_buf); X free(ident_buf); X return 0; X} X#endif /* DBM_XREFS */ SHAR_EOF echo 'File trn-3.6/bits.c is complete' && $shar_touch -am 1118220194 'trn-3.6/bits.c' && chmod 0644 'trn-3.6/bits.c' || echo 'restore of trn-3.6/bits.c failed' shar_count="`wc -c < 'trn-3.6/bits.c'`" test 17163 -eq "$shar_count" || echo "trn-3.6/bits.c: original size 17163, current size $shar_count" rm -f _sharnew.tmp fi # ============= trn-3.6/bits.h ============== if test -f 'trn-3.6/bits.h' && test X"$1" != X"-c"; then echo 'x - skipping trn-3.6/bits.h (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting trn-3.6/bits.h (text)' sed 's/^X//' << 'SHAR_EOF' > 'trn-3.6/bits.h' && X/* $Id: bits.h,v 3.0 1991/09/09 20:18:23 davison Trn $ X */ X/* This software is Copyright 1991 by Stan Barber. X * X * Permission is hereby granted to copy, reproduce, redistribute or otherwise X * use this software as long as: there is no monetary profit gained X * specifically from the use or reproduction of this software, it is not X * sold, rented, traded or otherwise marketed, and this copyright notice is X * included prominently in any copy made. X * X * The authors make no claims as to the fitness or correctness of this software X * for any use whatsoever, and it is provided as is. Any use of this software X * is at the user's own risk. X */ X XEXT char *found_bits INIT(Nullch); XEXT ART_NUM found_min; X X/* if subscripting is faster than shifting on your machine, define this */ X#undef USESUBSCRIPT X#ifdef USESUBSCRIPT XEXT char powerof2[] INIT({1,2,4,8,16,32,64,128}); X#define pow2(x) powerof2[x] X#else X#define pow2(x) (1 << (x)) X#endif X X#define foundart(a) (found_bits[((a)-found_min) / BITSPERBYTE] \ X |= pow2(((a)-found_min) % BITSPERBYTE)) X#define artismissing(a) (!(found_bits[((a)-found_min) / BITSPERBYTE] \ X & pow2(((a)-found_min) % BITSPERBYTE))) X XEXT int dmcount INIT(0); X Xvoid bits_init _((void)); Xvoid rc_to_bits _((void)); Xvoid bits_to_rc _((void)); Xvoid setfoundbits _((void)); Xvoid setmissingbits _((void)); Xvoid onemore _((ARTICLE*)); Xvoid oneless _((ARTICLE*)); Xvoid onemissing _((ARTICLE*)); Xvoid unmark_as_read _((void)); Xvoid set_read _((ARTICLE*)); Xvoid set_unread _((ARTICLE*)); Xvoid delay_unmark _((ARTICLE*)); Xvoid mark_as_read _((void)); Xvoid check_first _((ART_NUM)); Xvoid yankback _((void)); Xint chase_xrefs _((bool_int)); SHAR_EOF $shar_touch -am 1110023094 'trn-3.6/bits.h' && chmod 0644 'trn-3.6/bits.h' || echo 'restore of trn-3.6/bits.h failed' shar_count="`wc -c < 'trn-3.6/bits.h'`" test 1654 -eq "$shar_count" || echo "trn-3.6/bits.h: original size 1654, current size $shar_count" rm -f _sharnew.tmp fi # ============= trn-3.6/rt-select.h ============== if test -f 'trn-3.6/rt-select.h' && test X"$1" != X"-c"; then echo 'x - skipping trn-3.6/rt-select.h (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting trn-3.6/rt-select.h (text)' sed 's/^X//' << 'SHAR_EOF' > 'trn-3.6/rt-select.h' && X/* $Id: rt-select.h,v 3.0 1992/12/14 00:14:15 davison Trn $ X*/ X/* The authors make no claims as to the fitness or correctness of this software X * for any use whatsoever, and it is provided as is. Any use of this software X * is at the user's own risk. X */ X X#define MAX_SEL 64 X XEXT bool sel_rereading INIT(0); XEXT int sel_mode INIT(0); XEXT int sel_threadmode INIT(0); X#define SM_THREAD 0 X#define SM_SUBJECT 1 X#define SM_ARTICLE 2 XEXT char *sel_mode_string; XEXT int sel_sort INIT(0); XEXT int sel_artsort INIT(4); XEXT int sel_threadsort INIT(0); X#define SS_DATE 0 X#define SS_SUBJECT 1 X#define SS_AUTHOR 2 X#define SS_COUNT 3 X#define SS_NUMBER 4 X#define SS_GROUPS 5 XEXT char *sel_sort_string; XEXT int sel_direction INIT(1); XEXT bool sel_exclusive INIT(FALSE); XEXT int sel_mask INIT(1); X XEXT bool selected_only INIT(FALSE); XEXT ART_UNREAD selected_count INIT(0); XEXT int selected_subj_cnt INIT(0); XEXT int added_articles INIT(0); X X#define VOIDPTR void X Xstruct sel_item { X VOIDPTR *ptr; X int line; X int sel; X}; X XEXT char *sel_chars; XEXT struct sel_item sel_items[MAX_SEL]; XEXT int sel_item_index; XEXT int sel_item_cnt; XEXT int sel_total_arts; XEXT int sel_prior_arts; XEXT int sel_page_arts; XEXT int sel_page_cnt; XEXT int sel_max_cnt; XEXT int sel_line; XEXT int sel_last_line; XEXT bool sel_at_end; XEXT ARTICLE **sel_page_app; XEXT SUBJECT *sel_page_sp; XEXT ARTICLE **sel_next_app; XEXT SUBJECT *sel_next_sp; XEXT ARTICLE *sel_last_ap; XEXT SUBJECT *sel_last_sp; X Xchar do_selector _((char_int)); X#define DS_POS 0 X#define DS_ASK 1 X#define DS_UPDATE 2 X#define DS_DISPLAY 3 X#define DS_RESTART 4 X#define DS_STATUS 5 X#define DS_QUIT 6 X X#ifdef DOINIT X Xstatic void empty_complaint _((void)); Xstatic void sel_cleanup _((void)); Xstatic int sel_command _((char_int)); X X#endif SHAR_EOF $shar_touch -am 1028161994 'trn-3.6/rt-select.h' && chmod 0644 'trn-3.6/rt-select.h' || echo 'restore of trn-3.6/rt-select.h failed' shar_count="`wc -c < 'trn-3.6/rt-select.h'`" test 1766 -eq "$shar_count" || echo "trn-3.6/rt-select.h: original size 1766, current size $shar_count" rm -f _sharnew.tmp fi # ============= trn-3.6/NEW ============== if test -f 'trn-3.6/NEW' && test X"$1" != X"-c"; then echo 'x - skipping trn-3.6/NEW (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting trn-3.6/NEW (text)' sed 's/^X//' << 'SHAR_EOF' > 'trn-3.6/NEW' && XThis file will aquaint you with the user-visible changes in trn 3.x. X XIf you're upgrading from trn 2.x see the discussion of the -a option, Xthe 't' command (newsgroup selection level), and the 'T' command X(article level & in kill files) for slight incompatibilities between Xtrn 2.5 and trn 3.0. X XChanges from trn 3.5 to trn 3.6: X X o Added support for slow network connections by: (1) making use X of the LIST ACTIVE extension (if available), X (2) beginning to display the received article as it is received X from nntp, and (3) making the Pnews (posting) script query the X group info more efficiently. X o Changed nntplist's command-line syntax slightly so that it is X more orthoganal and so that it can pass an argument to LIST X ACTIVE or LIST NEWSGROUPS. ** If you use nntplist in your own X scripts you'll need to switch them over to using the -o (output) X option. ** X o Added the Ctrl-E command to display the end of the current article. X o Enhanced the ':' command to operate on non selected thread/articles X (use ::cmd) or to operateon just the current thread (use :.cmd or X ::.cmd). X o Added a 't' modifier for the search command to start the search X at the top of the group. E.g.: /subject string/t:+ X The default for searches in the selector has always been the top X of the group, so this only affects the command while reading X articles. X o Improved the catchup command to allow you to specify an X article count to leave unread in the group. X o Added a new sort order for the article selector -- by 'n'umber. X o Enhanced the %( arg = regex ? : ) syntax to allow a % expansion X in the regex portion of the comparison. X o Enhanced xref code to not go sub-optimal on C news's single-group X xref lines. X o Added support for generic authentification (available in the X reference NNTP 1.5.12 and INN 1.5). X o Fixed an elusive crash bug that would not let some people run X trn from cron. X o Other misc. bug fixes. X XChanges from trn 3.4.1 to trn 3.5: X X o Enhanced the -p option to allow you to select how you'd like X your postings to be selected. The default (which works the same X as before) is -p (select your posting and its replies). Also X available is -p+ (select all postings in the thread) and -pp X (select the *parent* article and its replies). X o Added the forward (^F) command to forward an article via mail. X o Improved the tab command (skip cited text) to skip empty lines X and choose the quotation character more intelligently. X o You can now junk an article in just the current group via X a search command using 'x'. E.g. /subject/:x X o Included some code from Olaf Titz X that allows you to tell trn to transform high-bit characters X into their 7-bit ascii equivilents. See the _C command and X the -Q option. X o Added the back-scroll command: 'B'. X o Added the -J option to allow you to join truncated subjects X into a common thread. The default for -J is 30 chars, not counting X the Re: portion. I have the lines "&-J27" and "X&+J" in my Babylon X 5 kill file to join all the Genie posts that get truncated into the X proper thread. X o Added the -K option to keep a group static (no new articles) while X you read it. Useful for people who have a really slow kill file X for a group -- use "&-K" and "X&+K" in such a kill file to make X only that group stop growing until you exit the group and re-enter. X o Added optional mouse support in an xterm window. X o Added a new intrp (%q) to get the value of the last quoted input X (%"). Useful for using elm for forwarding articles as it needs X the answer to the question "To?" on the command line: X -EFORWARDPOSTER="elm -i %h -s '%'[subject]' %q" X (though you may wish to redefine the FORWARDHEADER variable too). X o Fixed bugs in the handling of thread kills in partially-threaded X groups (Tj now works even if the -a option wasn't specified) and X and in the handling of the subject-kill command (Aj). X o New files, HINTS.TRN is like HINTS but in a better format. X (I renamed it to avoid conflicts with the directory "hints"). X o Portability enhancements to Configure and the support scripts. X o Some fairly major and minor bugs fixed. X XChanges from trn 3.3 to trn 3.4.1: X X o Made the kill-file handling more consistent in how it X deals with the THRU line. It now only ignores the THRU X line for all selection commands. You can turn off this X exception (and thus make all commands obey the THRU line) X by turning off the -k option (using +k). You can also X specify the 'I' modifier or the 'N' modifier to killfile X searches to have them either ignore or not-ignore the X THRU line, respectively. X o Changed the %'s interp to not supply the leading and X trailing single quotes to make it more useful. X o The NNTP trn attempts to reconnect to the news server X after it times out. If it is successful, trn continues. X o The command /subj/M no longer assumes you meant /subj/r:M. X o Automatically-generated killfile commands (e.g. the 'K' X command) now escape a '/' that occurs in the subject string. X o The _+ command (select whole thread) now starts reading X the thread from the first unread article. X o The -p self-matching code was improved to match a user's X name more exactly so that people with short login names X don't get improper matches. X o Pnews was enhanced to deal with Followup-To: poster better X when you choose to post anyway -- it now puts the user's X address into the Cc: header and automatically corrects the X Newsgroups: line. X o Pnews returns to the prompt after an inews error instead of X aborting. You can still choose to 'a'bort, if you like. X o Speller now passes the ispell_options from Configure to X spell, and Configure has been enhanced to prompt you for X the options if either ispell or (new!) vspell can't be X found. X o Added the file Policy.sh.SH that puts your policy choices X from the config.sh file into hints/Policy.sh. This allows X you to use the Policy.sh file to prime the Configure choices X on multiple machines or in the mthreads package without X machine-specific selections getting in the way. X o Upgraded Configure to the latest metaconfig release. X o Fixed some MIME bugs and made the handling a little smarter. X o Nested comment warnings removed from various include files. X o Fixed several crash bugs and several nusiance bugs, including: X * the problem with the NNTP trn mangling the date of X new news groups (which caused either groups to get missed X or groups to be re-offered). X * the problem with the NNTP trn that caused it to think X certain lines that begin with a '.' are the end of the X list marker and quit when it got confused. X * and lots more... X XChanges from trn 3.2 to trn 3.3: X X o Newsetup now looks for NEWSLIB/subscriptions for a default list X of groups to subscribe the user to. If the file doesn't exist X the NNTP version will attempt to grab it via the LIST SUBSCRIPTIONS X command (available in INN and some nntp patches). X [HINT: if you want your subscription file to default to all X groups in the active file, link your subscription file to your X active file -- trn will strip the info past the first space X when it processes the .newsrc.] X o The file newsnews will now default to a simple version update X message instead of a welcome-to trn message (which is now provided X by the newsetup file when creating a new .newsrc for a user). X I still encourage you to install your own custom newsnews X when trn is updated (and trn still doesn't install newsnews X automatically -- you have to make this decision for your self). X o Redirected and disabled groups (marked by '=' or 'x' in the active X file) are now handled better, allowing you to read any remaining X articles after a group gets redirected or disabled and warning you X to either start using the new group name or that the group will X not be receiving any new news. X o Mime support is now prompted for in Configure and your system's X display/store commands are remembered. We also handle a continued X Content-Type header correctly now. X o The tick (') interp modifier will generate a tick-quoted string X with all ticks inside the string quoted. For example, %'s might X generate (INCLUDING the "'"s) 'Ticks aren\'t a problem.' X o If the environment variable FAST_PNEWS == y Pnews skips the "Are X you sure?" question and the "include file" prompt. You can put X -EFAST_PNEWS=y in the global INIT file, if you so desire. X o Various bug fixes. X XChanges from trn 3.1 to trn 3.2: X X o Configure and the include file structure has been improved to X install easier on more systems. X o Fixed some non-portable test statements in Pnews. X o Added the -Z option to allow you to turn on/off support for the X two different database formats (-Zt, -Zo, -Zot, or +Z). X o Configure now allows you set the default database support to X thread files, overview files, both or none. X o Trn and its support scripts handle ~/dirs in the newslib or X rnlib better. X o Various bug fixes. X XChanges from trn 3.0 to trn 3.1: X X o Added a new header-searching syntax: /string/Hheader:cmd. X This allows you to match a string on any header that trn X knows about and is faster on the NNTP side than full-header X matching. Example: /: .../Hlines:j would junk all postings X longer than 99 lines. X o Two new commands can be put into a group's kill file: *j X (kill all articles from THRU to the end of the group) and *X X (kill all unselected articles from THRU to the end of the group). X o Pnews (using artcheck) now checks the active file as well as X the newsgroups file for each group on the Newsgroups line. This X lets you know whenever you specify a group that doesn't exist. X Also, the NNTP version has been fixed to provide full checking. X o Pnews/Rnmail have been modified to allow you to type either upper X or lower case for the response letters, and use "sp*ell" in addition X to "c*heck" for the spelling checker ("s*end" is unchanged). X o Pnews/Rnmail each have a pre-edit signature appending option. X If you use the file DOTDIR/.news_sig INSTEAD of .signature Pnews X will append your signature before you edit the file. Rnmail uses X the file DOTDIR/.mail_sig. Note also that the names may be X customized with the environment variables NEWSSIGNATURE and X MAILSIGNATURE, if desired (allowing a per-group signature). X o Added the modifiers '>' and ')' to interpreted strings. For X example: %>f gives you the address only on the From line, X while %)f gives you the real name portion. X o Added the 'O' command (newsgroup level) that works just like 'o' X except that it does not visit empty groups. X o The killfile is fully saved before manual editing with Ctrl-K X (message-id commands used to be saved only on exit from the group). X o The screen is now refreshed when the window size changes. X o Trn now makes use of stdlib.h, unistd.h (if available) and does a X more intelligent inclusion of time.h & sys/time.h (as needed). X o Trn doesn't loop through the current thread if unread articles X still exist in it. Also fixed various problems with '>' & 'P'. X o The 'D' command in the selector no longer jumps back to the top. X o The NNTP version has a different new-article aquisition strategy. X Your nntp server must send up-to-date information in response to X the GROUP command (INN's nnrpd does) for a group to expand while X you're in it. Also, you can now set the minimum time for trn to X wait (see -z) before it refetches the active file at the end of X the newsgroups. The default is 5 minutes. X o Optional metamail support pauses between the headers and the X metamail-interpreted article. Also, the 'v' command displays the X raw article without metamail processing. X o Numerous portability changes and bug fixes. X XChanges from trn 2.5 to trn 3.0: X X o Trn is now capable of reading more news database formats. It X currently supports news overview (.overview files), mthreads X (.thread files), and direct threading of the articles. The X NNTP version supports the XTHREAD and XOVER NNTP extensions. X If you compile trn with support for both formats it will figure X out which groups (or which server) has which type of data and X act accordingly. X o Mthreads is now a separate package from trn since not everyone X will need to use it. Look for it in the same place you found X trn. X o Trn attempts to build some useful default macros for your X terminal's arrow keys. On the article level they move around X in the thread; in the selector they change pages (left/right) X and switch selections (up/down); on the newsgroup level they X move by group (up/down) and enter a group (right). If you X don't like this, turn it off with the +A option. X o There's a new search scope -- the from line. For example: X use /author/f+ to search for and select 'author's articles. X o The thread selector has been extended to be a subject and X article selector. Use the 'S'et selector command to change X modes or use '=' to toggle between the article selector and X the subject/thread selector (whichever was last in use). X o The selector can now be sorted in a variety of ways: by date, X subject, author, article count (in the subject/thread selector), X or a combination of subject and date (in the article selector). X The default is date order of the oldest unread article in a thread. X Use the 'O'rder command to pick a new one or use 'R' to reverse X the sort. See also the "-O" option to set your X favorite mode and order. You can even put a "&-Oas" command (for X example) into a group's kill file to set a per-group default. X o The selector allows you to exclude all the non-selected articles X from the display (i.e. narrow it) -- use 'E' to toggle this mode. X o The selector has two new selection commands: '*' is used to select X (or deselect) the current item and all other items with the same X subject (useful in the article selector); '#' is used to make an X overriding selection that immediately reads the current item X ignoring all other selections. X o You can now type 'M' in the selector to mark the current item's X articles as read-but-returning and press 'Y' to yank back and X select these articles before exiting the group. X o Selections via searches are article-oriented (/subj/+) or X thread-/subject-oriented (/subj/++). The article selector's X default command is "+", while the thread/subject selector's is X "++". In other words doing a "/subj" search with no specified X command selects whatever type of object you're looking at in the X selector. X o If you specify the "-p" option, your postings and any replies to X them are auto-selected whenever trn encounters them. X o The '+' command in a non-threaded group visits the subject selector. X You can also use "_a", "_s", "_t" or "_T" to force the article, X subject, thread, or thread-but-I'll-settle-for-subject selector. X o The selector displays subjects/threads that are partially-selected X with a '*'. Fully-selected items are marked with a '+', as before. X Use the article selector (possibly with 'E'xclusive set) to see X which articles are selected in a partially-selected group (or just X read them). X o The selector remembers which subjects you selected (and didn't kill) X and marks any newly-arriving articles in these subjects as selected X until you exit the group. X o The medium display mode of the thread selector has been improved X to make it more readable. X o The selector will leave out the middle portion of a subject that is X too long to display the last two words of the subject. If you don't X like this, use the -u option to leave them unbroken. X o 'T'hread KILL commands now use message-ids to either junk X or select articles. The 'T' command has been extended to be X more flexible on the article level and has been added to the X selector. X o Another new command 'A'dds selection or kill commands to the KILL X file, and works from both the article level and the selector. X o The tree display has been updated to display unread-but-not- X selected articles as . Other unread articles are still [x], X while read articles still display as (x). X o Trn can enter a group without thread information available and X thread it in the background while you read. Articles that have X references that may or may not exist show up as "(?)". If you X visit an article like this and wait there, the screen will update X when we know for sure one way or the other (after processing more X of the group). X o The -a option is used to tell trn to thread all of the X articles on entry to the group. If you don't specify this X option a group may have a few (or many) articles that get X threaded in the background and won't show up on the tree X display until trn processes them. X o Pressing "_+" on the article level will select the entire thread X associated with the current article -- useful if you've selected X individual articles and wish to read the rest of the discussion. X Use "_-" to deselect the current thread. X o The commands _N and _P move to the next and previous article X in numberical (arrival) order (article level). Thus, you can X use the command "._P" on the newsgroup level to start reading X a group from the very last article to arrive. X o The 't' command on the newsgroup level now turns OFF reading a X group with threads (this setting is stored in the .newsrc file, X so it is remembered from session to session). Trn 2.x used this X to force threading to be turned ON, but it wasn't usually needed X for normal operation. To temporarily turn threads on once inside X a non-threaded group, use the 't' or "_t" commands (article level) X or the "St" command (selector). X o Trn now checks for the environment variable TRNMACRO on startup X (which defaults to DOTDIR/.trnmac) before checking for the usual X RNMACRO (DOTDIR/.rnmac) file. If you're running trn in its rn- X compatible mode, only RNMACRO is tried. X o The threaded and non-threaded data in a group has been unified, X resulting in more cached information on the non-threaded side X (such as the from line) and more efficient handling of missing X articles, just to name two benefits. X o The newsgroup information is freed when we enter a new group, X not when we exit the current group. This means that if you X quit out of a group (even accidentally), you can go back in X and everything is still there except the selections, which X get cleared on group exit. X o KILL file processing will now ignore the THRU line as much as X possible without slowing down the handling of KILL files. X If you have really slow searches (header or article searches) X or you use trn without a database it will use the THRU line X to only search an article one time (as it would in rn). This X means that if you have subject-oriented selection commands you X don't have to worry about missing articles if you don't read all X of them the first time you enter a group after they arrive. This X also means that you won't have to edit your local kill file to X remove the THRU line to force a re-scan -- this is now unnecessary. X o Header parsing is now done in-memory, making threading and X caching of articles much faster. This especially helps out X NNTP users because trn used to write a tmp file for every X header parse. X o Several new mode letters (accessed by %m in macros) were added. X The most significant are 'f' for the end (Finis) of the newsgroup X selection level (instead of 'n') and 'e' for the end of the article X reading level (instead of 'a'). X o A new % modifier has been introduced: "%:FMTx". This allows you X to apply a printf-style column format to a regular %x expansion. X For example, %:-50.50s would left-justify the subject into 50 X characters, exactly. X o The -f option will make trn go a little faster by getting rid of the X delay/prompt after kill file processing, printing the "skipping X article" message, and printing the "Depositing KILL command" message. X This is the default if -t (terse) is specified, but can be overriden X by specifying +f after the -t option. X o A new option for the gadget-conscious (-B) displays a spinner when X trn is processing articles in the background. X o Added the -G option to make the newsgroup 'g'o command look for X near matches (for those typing mistakes). X o New newsgroups that are left unsubscribed are not appended to the X .newsrc unless you use the -I option or you're running an NNTP X version that does not use the NEWGROUPS code. X o Support for metamail's mime handling is now built into the code -- X see the METAMAIL define in common.h. X o Pnews does more checking of your article before posting, has a X spelling-check option, and allows the Cc: header to be used to X send mail while posting the article. X XChanges from trn 1.0.3 to trn 2.5: X X o Added the '(' and ')' commands (article level) to move to an X article's previous/next sibling, including "cousin" siblings. X o The 'A'bandon command (newsgroup level) forgets all changes to the X current newsgroup since you first started trn. X o The thread selector now allows you type type 'c'/'y' to catchup X the group without chasing cross-references. X o Added 'z' and 'Z' commands (article level) supersede the current X article ('Z' also including the original text). X o The g command (newsgroup level) will go to a newsgroup by number X where the the number corresponds to that shown in the 'L'ist X command. X o Added the "-o" option to use the old method of junking articles in X the thread commands (they didn't chase cross-references in trn 1.x) X o Added the "-b" option to read articles in a breadth-first descent X of the article tree. You can specify this command at runtime to X switch from breadth-first (type "&-b") to depth-first ("&+b). X o Added the "-j" option to tell trn to pass control characters through X the pager unharmed. SHAR_EOF $shar_touch -am 1121152494 'trn-3.6/NEW' && chmod 0644 'trn-3.6/NEW' || echo 'restore of trn-3.6/NEW failed' shar_count="`wc -c < 'trn-3.6/NEW'`" test 21843 -eq "$shar_count" || echo "trn-3.6/NEW: original size 21843, current size $shar_count" rm -f _sharnew.tmp fi # ============= trn-3.6/common.h ============== if test -f 'trn-3.6/common.h' && test X"$1" != X"-c"; then echo 'x - skipping trn-3.6/common.h (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting trn-3.6/common.h (binary)' sed 's/^X//' << 'SHAR_EOF' > _sharuue.tmp && Xbegin 600 trn-3.6/common.h XM+RH@)$ED.B!C;VUM;VXN:"QV(#,N,"`Q.3DR+S`R+S(S(#(Q.C(U.C,Y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L XM*2!M96UC;7`H*',I+"AD*2PH;"DI"B,@96YD:68*(V5N9&EF"B-I9F1E9B!( XM05-?345-0U!9"B,@:69N9&5F(&)C;W!Y"B,@("!D969I;F4@8F-O<'DH2@H9"DL*',I+"AL*2D*(R!E;F1I9@HC96YD:68*(VEF9&5F XM($A!4U]-14U3150*(R!I9FYD968@8GIEF5R;RAS XM+&PI(&UE;7-E="@H7!E(&-H87(@*B\*"B-I9F1E9B!355!03$5-14Y47U-44DE. XM1U]("F-H87()*FEN9&5X*"D["F-H87()*G)I;F1E>"@I.PIC:&%R"2IS=')C XM870H*3L*8VAA<@DJ"`J+PI%6%0@:6YT(&UA>%]T7,@24Y)5"A&04Q312D["0D)+RH@+6$@*B\* XM15A4(&)O;VP@875T;U]A2`M92`J+PHC96YD:68*15A4(&)O;VP@9FEN9&QA2!)3DE4*$9!3%-% XM*3L)"0D)+RH@+78@*B\*(V5N9&EF"D585"!B;V]L('%U:6-K5]O=@D)"0D)"2\J("U: XM("HO"B-I9F1E9B!54T5?3U8*"4E.250H,2D["B-E;'-E"@E)3DE4*#`I.PHC XM96YD:68*15A4(&EN="!T2`E _sharnew.tmp echo 'x - extracting trn-3.6/Configure (text)' sed 's/^X//' << 'SHAR_EOF' > 'trn-3.6/Configure' && X#! /bin/sh X# X# If these # comments don't work, trim them. Don't worry about any other X# shell scripts, Configure will trim # comments from them for you. X# X# (If you are trying to port this package to a machine without sh, X# I would suggest you have a look at the prototypical config.h.SH file X# and edit it to reflect your system. Some packages may include samples X# of config.h for certain machines, so you might look for one of those.) X# X# Yes, you may rip this off to use in other distribution packages. This X# script belongs to the public domain and cannot be copyrighted. X# X# (Note: this Configure script was generated automatically. Rather than X# working with this copy of Configure, you may wish to get metaconfig. X# The dist-3.0 package (which contains metaconfig) was posted in X# comp.sources.misc so you may fetch it yourself from your nearest X# archive site. Check with Archie if you don't know where that can be.) X# X X# $Id: Head.U,v 3.0.1.3 1993/12/15 08:15:07 ram Exp $ X# X# Generated on Thu May 5 12:36:48 PDT 1994 [metaconfig 3.0 PL22] X Xcat >/tmp/c1$$ </tmp/c2$$ </dev/null 2>&1; then X : already under /bin/ksh X else X cat <<'EOM' X(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.) XEOM X exec /bin/ksh $0 "$@" X fi Xelse X : Warn them if they use ksh on other systems X (PATH=.; alias -x) >/dev/null 2>&1 && \ X cat <<'EOM' X(I see you are using the Korn shell. Some ksh's blow up on Configure, Xespecially on exotic machines. If yours does, try the Bourne shell instead.) XEOM Xfi X X: Configure runs within the UU subdirectory Xtest -d UU || mkdir UU Xcd UU && rm -f * X Xd_bsd='' Xd_eunice='' Xd_xenix='' Xeunicefix='' XMcc='' Xawk='' Xbasename='' Xbash='' Xcat='' Xcp='' Xcpp='' Xcsh='' Xdate='' Xdiff='' Xecho='' Xed='' Xegrep='' Xexpr='' Xgrep='' Xinews='' Xispell='' Xksh='' Xless='' Xlint='' Xmail='' Xmetamail='' Xmhn='' Xmkdir='' Xmore='' Xmunpack='' Xmv='' Xnroff='' Xpg='' Xrm='' Xrmail='' Xsed='' Xsendmail='' Xsmail='' Xsort='' Xspell='' Xtail='' Xtest='' Xtr='' Xuname='' Xuniq='' Xuuname='' Xvi='' Xvspell='' Xwho='' Xhint='' Xmyuname='' Xsrcdir='' Xvincludes='' Xvpath='' XId='' XLog='' Xactive='' Xacttimes='' Xd_acttimes='' Xmyactive='' Xbin='' Xbinexp='' Xinstallbin='' Xcc='' Xccflags='' Xcppflags='' Xldflags='' Xlkflags='' Xoptimize='' Xcf_by='' Xcf_time='' Xcontains='' Xcpplast='' Xcppminus='' Xcpprun='' Xcppstdin='' Xd_ftime='' Xaphostcmd='' Xd_gethname='' Xd_phostcmd='' Xd_uname='' Xd_getpwent='' Xd_getcwd='' Xd_getwd='' Xd_havetlib='' Xtermlib='' Xd_ignoreorg='' Xd_internet='' Xd_memcmp='' Xd_memcpy='' Xd_memset='' Xd_mimeshow='' Xd_mimestore='' Xmimeshow='' Xmimestore='' Xd_newsadm='' Xnewsadmin='' Xd_nntp='' Xd_xdata='' Xd_genauth='' Xservername='' Xd_nolnbuf='' Xd_normsig='' Xjobslib='' Xd_novoid='' Xvoid='' Xd_portable='' Xd_rdchk='' Xd_rename='' Xd_sigblock='' Xd_sighold='' Xd_sizet='' Xd_strccmp='' Xd_strchr='' Xd_strftime='' Xstrftimec='' Xstrftimeo='' Xd_libndir='' Xd_usendir='' Xlibndir='' Xndirc='' Xndiro='' Xd_vfork='' Xd_voidsig='' Xsignal_t='' Xdefeditor='' Xfilexp='' Xd_dirnamlen='' Xi_dirent='' Xi_ptem='' Xi_stdlib='' Xi_string='' Xstrings='' Xi_sysdir='' Xd_voidtty='' Xi_bsdioctl='' Xi_sysfilio='' Xi_sysioctl='' Xi_syssockio='' Xi_sysndir='' Xi_sgtty='' Xi_termio='' Xi_termios='' Xi_systime='' Xi_time='' Xi_unistd='' Xi_vfork='' Xispell_options='' Xispell_prg='' Xlibc='' Xplibpth='' Xxlibpth='' Xlibs='' Xcitydist='' Xcntrydist='' Xcontdist='' Xlocdist='' Xmultistatedist='' Xorgdist='' Xstatedist='' Xmailer='' Xmailfile='' Xinstallmansrc='' Xmanext='' Xmansrc='' Xmansrcexp='' Xmboxchar='' Xc='' Xn='' Xd_berknames='' Xd_passnames='' Xd_usgnames='' Xnametype='' Xinewsloc='' Xnewslib='' Xnewslibexp='' Xnewsspool='' Xorgname='' Xpackage='' Xspackage='' Xpager='' Xphost='' Xphostcmd='' Xprefshell='' Xinstallprivlib='' Xprivlib='' Xprivlibexp='' Xrootid='' Xsharpbang='' Xshsharp='' Xspitshell='' Xstartsh='' Xsysman='' Xd_usemt='' Xd_useov='' Xoverviewdir='' Xthreaddir='' Xtrn_init='' Xtrn_select='' Xnm_opt='' Xrunnm='' Xusenm='' Xincpath='' Xmips='' Xmips_type='' Xusrinc='' Xd_whoami='' XCONFIG='' X X: set package name Xpackage=trn Xfirst=`echo $package | sed -e 's/^\(.\).*/\1/'` Xlast=`echo $package | sed -e 's/^.\(.*\)/\1/'` Xspackage=`echo $first | tr '[a-z]' '[A-Z]'`$last X X: determine where the sources are Xcd .. Xobjdir=`pwd` X_srcdir=`expr X$0 : 'X\(.*\)/'` Xif test -f MANIFEST -o ! -f $_srcdir/MANIFEST; then X _srcdir='..' X _vpath='.' Xelse X case "$_srcdir" in X /*) ;; X *) _srcdir=`(cd $_srcdir ; pwd)` ;; X esac X echo "Aha! Your $package sources are really in $_srcdir." X _vpath="$_srcdir" Xfi Xcd UU X X: script used to extract .SH files with variable substitutions Xcat >extract <<'EOS' XCONFIG=true Xcase "$_srcdir" in X..) _srcdir='.';; Xesac Xecho "Doing variable substitutions on .SH files..." Xif test -f $_srcdir/MANIFEST; then X set x `awk '$1 ~ /.SH$/ {print $1}' $_srcdir/MANIFEST` Xelse X echo "(Looking for .SH files under the current directory.)" X set x `(cd $_srcdir ; find . -name "*.SH" -print)` Xfi Xshift Xcase $# in X0) set x *.SH ; shift X case "$1" in X \*.SH) shift ;; X esac X ;; Xesac Xfor file in $*; do X . $_srcdir/$file Xdone XEOS X X: produce awk script to parse command line options Xcat >options.awk <<'EOF' XBEGIN { X optstr = "deEf:hrsSV"; # getopt-style specification X X len = length(optstr); X for (i = 1; i <= len; i++) { X c = substr(optstr, i, 1); X if (i < len) a = substr(optstr, i + 1, 1); else a = ""; X if (a == ":") { X arg[c] = 1; X i++; X } X opt[c] = 1; X } X} X{ X expect = 0; X str = $0; X if (substr(str, 1, 1) != "-") { X printf("'%s'\n", str); X next; X } X len = length($0); X for (i = 2; i <= len; i++) { X c = substr(str, i, 1); X if (!opt[c]) { X printf("-%s\n", substr(str, i)); X next; X } X printf("-%s\n", c); X if (arg[c]) { X if (i < len) X printf("'%s'\n", substr(str, i + 1)); X else X expect = 1; X next; X } X } X} XEND { X if (expect) X print "?"; X} XEOF X X: process the command line options Xset X `for arg in "$@"; do echo $arg; done | awk -f options.awk` Xeval "set $*" Xshift Xrm -f options.awk X X: set up default values Xfastread='' Xreuseval=false Xconfig_sh='' Xalldone='' Xerror='' Xsilent='' Xextractsh='' X X: option parsing Xwhile test $# -gt 0; do X case "$1" in X -d) shift; fastread=yes;; X -e) shift; alldone=cont;; X -f) X shift X cd .. X if test -r "$1"; then X config_sh="$1" X else X echo "Configure: cannot read config file $1." >&2 X error=true X fi X cd UU X shift;; X -h) shift; error=true;; X -r) shift; reuseval=true;; X -s) shift; silent=true;; X -E) shift; alldone=exit;; X -S) shift; extractsh=true;; X -V) echo "Configure generated by metaconfig 3.0 PL22." >&2 X exit 0;; X --) break;; X -*) echo "Configure: unknown option $1" >&2; shift; error=true;; X *) break;; X esac Xdone X Xcase "$error" in Xtrue) X cat >&2 <&1 Xcase "$silent" in Xtrue) exec 1>/dev/null;; Xesac X Xcase "$extractsh" in Xtrue) X case "$config_sh" in X '') config_sh='config.sh'; config='./config.sh';; X /*) config="$config_sh";; X *) config="./$config_sh";; X esac X echo " " X echo "Fetching answers from $config_sh..." X cd .. X . $config X echo " " X . ./UU/extract X rm -rf UU X echo "Done." X exit 0 X ;; Xesac X X: Eunice requires " " instead of "", can you believe it Xecho " " X: Here we go... Xecho "Beginning of configuration questions for $package." X Xdefine='define' Xundef='undef' Xsmallmach='pdp11 i8086 z8000 i80286 iAPX286' Xrmlist='' X Xtrap 'echo " "; rm -rf $rmlist; exit 1' 1 2 3 15 X X: We must find out about Eunice early Xeunicefix=':' Xif test -f /etc/unixtovms; then X eunicefix=/etc/unixtovms Xfi Xif test -f /etc/unixtovms.exe; then X eunicefix=/etc/unixtovms.exe Xfi X X: list of known cpp symbols Xattrlist="__alpha __bsdi__ BSD_NET2 DGUX M_I186 M_I286 M_I386" Xattrlist="$attrlist M_I8086 M_XENIX UTS __DGUX__" Xattrlist="$attrlist _AIX __STDC__ __m88k__ ansi bsd4_2 gcos gimpel" Xattrlist="$attrlist hp9000s300 hp9000s400 hp9000s500 hp9000s700" Xattrlist="$attrlist hp9000s800 hpux" Xattrlist="$attrlist i186 i386 i486 i8086 iAPX286 ibm interdata" Xattrlist="$attrlist m88k mc300 mc500 mc68000 mc68k mc700 mert" Xattrlist="$attrlist mips NeXT ns16000 ns32000 nsc32000 os" Xattrlist="$attrlist __osf__ pdp11 posix" Xattrlist="$attrlist pyr sinix sony sparc sun tower tower32 tower32_600" Xattrlist="$attrlist tower32_800 tss u3b2 u3b20 u3b200 u3b5 ultrix unix" Xattrlist="$attrlist __unix__ vax venix xenix z8000" X Xi_sysselct='' X: change the next line if compiling for Xenix/286 on Xenix/386 Xxlibpth='/usr/lib/386 /lib/386' X X: general looking path for locating libraries Xlibpth='/usr/lib/large /lib '$xlibpth' /lib/large' Xlibpth=$libpth' /usr/lib/small /lib/small' X X: no additional library wanted by default Xlibswanted='' X XCTRLA=`echo a | tr a '\001'` Xlarge='' Xinclwanted='/usr/include/NET-5000' X Xlibswanted='malloc bsd socket bsdipc sun net hdb bbn str nls nsl c_s intl x ucb' X X: Some greps do not return status, grrr. Xecho "grimblepritz" >grimble Xif grep blurfldyick grimble >/dev/null 2>&1 ; then X contains=contains Xelif grep grimblepritz grimble >/dev/null 2>&1 ; then X contains=grep Xelse X contains=contains Xfi Xrm -f grimble X: the following should work in any shell Xcase "$contains" in Xcontains*) X echo " " X echo "AGH! Grep doesn't return a status. Attempting remedial action." X cat >contains <<'EOSS' Xgrep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp XEOSS Xchmod +x contains Xesac X X: first determine how to suppress newline on echo command Xecho " " Xecho "Checking echo to see how to suppress newlines..." X(echo "hi there\c" ; echo " ") >.echotmp Xif $contains c .echotmp >/dev/null 2>&1 ; then X echo "...using -n." X n='-n' X c='' Xelse X cat <<'EOM' X...using \c XEOM X n='' X c='\c' Xfi Xecho $n "The star should be here-->$c" Xecho '*' Xrm -f .echotmp X X: Now test for existence of everything in MANIFEST Xecho " " Xif test -f $_srcdir/MANIFEST; then X echo "First let's make sure your kit is complete. Checking..." >&4 X awk '$1 !~ /PACK[A-Z]+/ {print $1}' $_srcdir/MANIFEST | split -50 X rm -f missing X for filelist in x??; do X (cd $_srcdir; ls `cat $objdir/UU/$filelist`) >/dev/null 2>>missing X done X if test -s missing; then X cat missing >&4 X cat >&4 <<'EOM' X XTHIS PACKAGE SEEMS TO BE INCOMPLETE. X XYou have the option of continuing the configuration process, despite the Xdistinct possibility that your kit is damaged, by typing 'y'es. If you Xdo, don't blame me if something goes wrong. I advise you to type 'n'o Xand contact the author (davison@borland.com). X XEOM X echo $n "Continue? [n] $c" >&4 X read ans X case "$ans" in X y*) X echo "Continuing..." >&4 X rm -f missing X ;; X *) X echo "ABORTING..." >&4 X kill $$ X ;; X esac X else X echo "Looks good..." >&4 X fi Xelse X echo "There is no MANIFEST file. I hope your kit is complete !" Xfi Xrm -f missing x?? X X: compute the number of columns on the terminal for proper question formatting Xcase "$COLUMNS" in X'') COLUMNS='80';; Xesac X X: set up the echo used in my read Xmyecho="case \"\$xxxm\" in X'') echo $n \"\$rp $c\" >&4;; X*) case \"\$rp\" in X '') echo $n \"[\$xxxm] $c\";; X *) X if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then X echo \"\$rp\" >&4 X echo $n \"[\$xxxm] $c\" >&4 SHAR_EOF : || echo 'restore of trn-3.6/Configure failed' fi echo 'End of archive part 2' echo 'File trn-3.6/Configure is continued in part 3' echo 3 > _sharseq.tmp exit 0