home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / mail / uucp / 1581 < prev    next >
Encoding:
Text File  |  1992-07-30  |  2.7 KB  |  79 lines

  1. Newsgroups: comp.mail.uucp
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!hermes.chpc.utexas.edu!news.utdallas.edu!corpgate!bnrgate!bwdls61!bwdlh118!clewis
  3. From: clewis@bwdlh118.bnr.ca (Chris Lewis)
  4. Subject: Re: "file" directives in the UUCP maps???
  5. Message-ID: <1992Jul30.174029.14834@bwdls61.bnr.ca>
  6. Sender: usenet@bwdls61.bnr.ca (Use Net)
  7. Nntp-Posting-Host: bwdlh118
  8. Organization: Bell Northern Research
  9. References: <1992Jul29.151151.28025@eecs.nwu.edu> <1992Jul30.020100.640@uunet.uu.net>
  10. Date: Thu, 30 Jul 1992 17:40:29 GMT
  11. Lines: 66
  12.  
  13. In article <1992Jul30.020100.640@uunet.uu.net> ziegast@godzilla.UU.NET (Eric W. Ziegast) writes:
  14. |phil@eecs.nwu.edu (William LeFebvre) writes:
  15. ||> I have noticed that quite a few of the maps now posted in comp.mail.maps
  16. ||> contain as the first line "file {...}" with the file name contained in
  17. ||> the curly braces.  This is the first line in the file AFTER extraction 
  18. ||> with sh.
  19. ||> 
  20. ||> Why are they there?
  21.  
  22. |Many people do something silimilar to the following when
  23. |rebuildiung UUCP alias tables:
  24.  
  25. |    cat uumap/u.* | some filters | pathalias | ...etc...
  26.  
  27. |If there's an error, pathalias would say something like:
  28.  
  29. |    "line 56437: syntax error"
  30.  
  31. |It's very hard to track down.  If one uses the "file" line at the top of
  32. |all of their files, they would more likely see:
  33.  
  34. |    "u.usa.va.2", line 74: syntax error
  35.  
  36. Another approach is to have the prefilter into pathalias do it.  In
  37. shell, it's something like this:
  38.  
  39.     for i in uumap/u.*
  40.     do
  41.         echo "file {`basename $i}`"
  42.         cat $i
  43.     done | pathalias ....
  44.  
  45. But this is rather inefficient.  Especially if the maps (or worse, some of the maps)
  46. are compressed:
  47.  
  48.     for i in uumap/u.*
  49.     do
  50.         echo "file {`basename $i .Z`}"
  51.         case $i in
  52.         *.Z)
  53.             zcat $i
  54.             ;;
  55.         *)
  56.             cat $i
  57.             ;;
  58.         esac
  59.     done | pathalias ....
  60.  
  61. The new version of unpackmaps (unpackmaps 4.0b) inserts the file directive
  62. automatically - in a considerably more efficient manner than the fragment above -
  63. it's all implemented in C, with a built-in decompress).  But now that the UUCP
  64. project is doing this themselves, you can turn this "feature" off - or not -
  65. it doesn't hurt or cost anything in terms of performance.  Is still convenient
  66. for making sure that local map overrides get reported properly even if you
  67. forget to put the file directive in.
  68.  
  69. There are other reasons for upgrading to pathalias 10 than just the "file"
  70. directive.  Pathalias 9 has a tendency to go into infinite CPU loops
  71. with certain combinations of maps and initial "root" point.
  72.  
  73. |It's much easier to track down the error when you know what file it's
  74. |in.
  75.  
  76. Sure is.  This is why I suggested the "file" directive to Peter Honeyman
  77. several years ago - it's just taken til now for the UUCP map project
  78. to get around to using it.
  79.