home *** CD-ROM | disk | FTP | other *** search
/ The UNIX CD Bookshelf / OREILLY_TUCB_UNIX_CD.iso / upt / examples / SOURCES / SHARUTIL / RTR / SHARUTIL. next >
Encoding:
Text File  |  1998-07-24  |  10.7 KB  |  364 lines

  1. --- ./doc/uuencode.1.orig    Tue Sep 26 10:25:13 1995
  2. +++ ./doc/uuencode.1    Mon Apr 28 08:12:46 1997
  3. @@ -42,7 +42,7 @@
  4.  [\-m] [ file ] name
  5.  .PP
  6.  .B uudecode
  7. -[-o outfile] [ file ]...
  8. +[-m] [-o outfile] [ file ]...
  9.  .SH DESCRIPTION
  10.  .I Uuencode
  11.  and
  12. @@ -91,6 +91,10 @@
  13.  or
  14.  .I name
  15.  is /dev/stdout the result will be written to standard output.
  16. +.I Uudecode 
  17. +will decode multiple files from a single input stream if the
  18. +.I -m
  19. +flag is used on the command line.
  20.  .I Uudecode
  21.  ignores any leading and trailing lines.  The program can automatically decide
  22.  which of the both supported encoding schemes are used.
  23. --- ./po/Makefile.in.in.orig    Mon Dec  4 11:19:48 1995
  24. +++ ./po/Makefile.in.in    Mon Apr 28 08:24:51 1997
  25. @@ -28,9 +28,9 @@
  26.  prefix = @prefix@
  27.  exec_prefix = @exec_prefix@
  28.  datadir = $(prefix)/@DATADIRNAME@
  29. -localedir = $(datadir)/locale
  30. -gnulocaledir = $(prefix)/share/locale
  31. -gettextsrcdir = $(prefix)/share/gettext
  32. +localedir = <installsharedir>/slib/locale
  33. +gnulocaledir = <installsharedir>/slib/locale
  34. +gettextsrcdir = <installsharedir>/slib/gettext
  35.  subdir = po
  36.  
  37.  INSTALL = @INSTALL@
  38. @@ -88,14 +88,16 @@
  39.  all: cat-id-tbl.c $(CATALOGS)
  40.  
  41.  $(PACKAGE).pot: $(POTFILES)
  42. -    $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
  43. +    echo $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
  44.        --add-comments --keyword=_ --keyword=N_ \
  45.        --files-from=$(srcdir)/POTFILES.in
  46. -    if cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \
  47. -      rm -f $(PACKAGE).po; \
  48. -    else \
  49. -      rm -f $(srcdir)/$(PACKAGE).pot \
  50. -        && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \
  51. +    -if test -f $(PACKAGE).po ; then \
  52. +       if cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \
  53. +         rm -f $(PACKAGE).po; \
  54. +       else \
  55. +         rm -f $(srcdir)/$(PACKAGE).pot \
  56. +           && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \
  57. +       fi \
  58.      fi
  59.  
  60.  cat-id-tbl.c: stamp-cat-id
  61. --- ./intl/Makefile.in.orig    Mon Dec  4 11:19:40 1995
  62. +++ ./intl/Makefile.in    Mon Apr 28 08:25:50 1997
  63. @@ -30,9 +30,9 @@
  64.  libdir = $(prefix)/lib
  65.  includedir = $(prefix)/include
  66.  datadir = $(prefix)/@DATADIRNAME@
  67. -localedir = $(datadir)/locale
  68. -gnulocaledir = $(prefix)/share/locale
  69. -gettextsrcdir = $(prefix)/share/gettext
  70. +localedir = <installsharedir>/slib/locale
  71. +gnulocaledir = <installsharedir>/slib/locale
  72. +gettextsrcdir = <installsharedir>/slib/gettext
  73.  aliaspath = $(localedir):.
  74.  subdir = intl
  75.  
  76. --- ./src/mail-files.in.orig    Sat Nov 25 19:03:28 1995
  77. +++ ./src/mail-files.in    Mon Apr 28 08:12:46 1997
  78. @@ -1,4 +1,4 @@
  79. -#! @SH@
  80. +#!<installdir>/bin/bash
  81.  # Mail a list of files, as they are.
  82.  # Copyright (C) 1990, 1995 Free Software Foundation, Inc.
  83.  # Franτois Pinard <pinard@iro.umontreal.ca>, 1991.
  84. --- ./src/mailshar.in.orig    Sat Nov 25 18:42:47 1995
  85. +++ ./src/mailshar.in    Mon Apr 28 08:12:46 1997
  86. @@ -1,4 +1,4 @@
  87. -#! @SH@
  88. +#!<installdir>/bin/bash
  89.  # Mail a multi-part shar from a list of files.
  90.  # Copyright (C) 1990, 1994, 1995 Free Software Foundation, Inc.
  91.  # Franτois Pinard <pinard@iro.umontreal.ca>, 1991.
  92. --- ./src/remsync.in.orig    Sat Nov 25 19:15:12 1995
  93. +++ ./src/remsync.in    Mon Apr 28 08:12:46 1997
  94. @@ -1,6 +1,6 @@
  95. -#! @PERL@
  96. +#!<installdir>/bin/perl --                        # -*-Perl-*-
  97.  # @configure_input@
  98. -eval "exec @PERL@ -S $0 $*"
  99. +eval "exec <installdir>/bin/perl -S $0 $*"
  100.      if $running_under_some_shell;
  101.  
  102.  # Synchronization tool for remote directories.
  103. @@ -33,9 +33,9 @@
  104.  $WORKDIR = ".remsync-work";    # directory name of unpacked synchro. package
  105.  $ORDERS = "orders";        # file name containaing synchro. directives
  106.  
  107. -$DIFF = "@DIFF@";        # GNU diff path
  108. -$TAR = "@TAR@";            # GNU tar path
  109. -$SH = "@SH@";            # Bash or sh path
  110. +$DIFF = "<installdir>/bin/diff";        # GNU diff path
  111. +$TAR = "<installdir>/bin/tar";            # GNU tar path
  112. +$SH = "<installdir>/bin/bash";            # Bash or sh path
  113.  
  114.  # Special constants.
  115.  
  116. --- ./src/uudecode.c.orig    Fri Dec  1 22:14:14 1995
  117. +++ ./src/uudecode.c    Mon Apr 28 08:12:46 1997
  118. @@ -65,11 +65,18 @@
  119.  static struct option longopts[] =
  120.  {
  121.    { "version", no_argument, NULL, 'v' },
  122. +  { "multiple", no_argument, NULL, 'm' },
  123.    { "help", no_argument, NULL, 'h' },
  124.    { "output-file", required_argument, NULL, 'o' },
  125.    { NULL, 0, NULL, 0 }
  126.  };
  127.  
  128. +#ifndef FALSE
  129. +#define FALSE 0
  130. +#define TRUE  1
  131. +#endif
  132. +static int multiple = FALSE;
  133. +
  134.  static int read_stduu __P ((const char *inname));
  135.  static int read_base64 __P ((const char *inname));
  136.  static int decode __P ((const char *, const char *));
  137. @@ -279,87 +286,95 @@
  138.    char buf[2 * BUFSIZ];
  139.    char *outname;
  140.    int do_base64 = 0;
  141. +  int first = 1;
  142. +  int ret;
  143.  
  144.    /* Search for header line.  */
  145.  
  146. -  while (1)
  147. +  while (multiple || first)
  148.      {
  149. -      if (fgets (buf, sizeof (buf), stdin) == NULL)
  150. -    {
  151. -      error (0, 0, _("%s: No `begin' line"), inname);
  152. -      return 1;
  153. -    }
  154. -
  155. -      if (strncmp (buf, "begin", 5) == 0)
  156. -    {
  157. -      if (sscanf (buf, "begin-base64 %o %s", &mode, buf) == 2)
  158. -        {
  159. -          do_base64 = 1;
  160. -          break;
  161. -        }
  162. -      else if (sscanf (buf, "begin %o %s", &mode, buf) == 2)
  163. -        break;
  164. -    }
  165. -    }
  166. -
  167. -  /* If the output file name is given on the command line this rules.  */
  168. -  if (forced_outname != NULL)
  169. -    outname = (char *) forced_outname;
  170. -  else
  171. -    {
  172. -      /* Handle ~user/file format.  */
  173. -
  174. -      if (buf[0] != '~')
  175. -    outname = buf;
  176. +      while (1)
  177. +        {
  178. +          if (fgets (buf, sizeof (buf), stdin) == NULL)
  179. +            {
  180. +              if (!first) return 0;
  181. +              error (0, 0, _("%s: No `begin' line"), inname);
  182. +              return 1;
  183. +            }
  184. +
  185. +          if (strncmp (buf, "begin", 5) == 0)
  186. +            {
  187. +              if (sscanf (buf, "begin-base64 %o %s", &mode, buf) == 2)
  188. +                {
  189. +                  do_base64 = 1;
  190. +                  break;
  191. +                }
  192. +              else if (sscanf (buf, "begin %o %s", &mode, buf) == 2)
  193. +                break;
  194. +            }
  195. +        }
  196. +
  197. +      /* If the output file name is given on the command line this rules.  */
  198. +      if (forced_outname != NULL)
  199. +        outname = (char *) forced_outname;
  200.        else
  201. -    {
  202. -      p = buf + 1;
  203. -      while (*p != '/')
  204. -        ++p;
  205. -      if (*p == '\0')
  206. -        {
  207. -          error (0, 0, _("%s: Illegal ~user"), inname);
  208. -          return 1;
  209. -        }
  210. -      *p++ = '\0';
  211. -      pw = getpwnam (buf + 1);
  212. -      if (pw == NULL)
  213. -        {
  214. -          error (0, 0, _("%s: No user `%s'"), inname, buf + 1);
  215. -          return 1;
  216. -        }
  217. -      n = strlen (pw->pw_dir);
  218. -      n1 = strlen (p);
  219. -      outname = (char *) alloca ((size_t) (n + n1 + 2));
  220. -      memcpy (outname + n + 1, p, (size_t) (n1 + 1));
  221. -      memcpy (outname, pw->pw_dir, (size_t) n);
  222. -      outname[n] = '/';
  223. -    }
  224. -    }
  225. +        {
  226. +          /* Handle ~user/file format.  */
  227. +
  228. +          if (buf[0] != '~')
  229. +            outname = buf;
  230. +          else
  231. +            {
  232. +              p = buf + 1;
  233. +              while (*p != '/')
  234. +                ++p;
  235. +              if (*p == '\0')
  236. +                {
  237. +                  error (0, 0, _("%s: Illegal ~user"), inname);
  238. +                  return 1;
  239. +                }
  240. +              *p++ = '\0';
  241. +              pw = getpwnam (buf + 1);
  242. +              if (pw == NULL)
  243. +                {
  244. +                  error (0, 0, _("%s: No user `%s'"), inname, buf + 1);
  245. +                  return 1;
  246. +                }
  247. +              n = strlen (pw->pw_dir);
  248. +              n1 = strlen (p);
  249. +              outname = (char *) alloca ((size_t) (n + n1 + 2));
  250. +              memcpy (outname + n + 1, p, (size_t) (n1 + 1));
  251. +              memcpy (outname, pw->pw_dir, (size_t) n);
  252. +              outname[n] = '/';
  253. +            }
  254. +        }
  255.  
  256. -  /* Create output file and set mode.  */
  257. +      /* Create output file and set mode.  */
  258.  
  259. -  if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0
  260. -      && (freopen (outname, "w", stdout) == NULL
  261. +      if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0
  262. +          && (freopen (outname, "w", stdout) == NULL
  263.  #if HAVE_FCHMOD
  264. -      || fchmod (fileno (stdout), mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  265. +              || fchmod (fileno (stdout), mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  266.  #else
  267. -      || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  268. +              || chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
  269.  #endif
  270. -      ))
  271. -    {
  272. -      error (0, errno, "%s: %s", outname, inname);
  273. -      return 1;
  274. +              ))
  275. +        {
  276. +          error (0, errno, "%s: %s", outname, inname);
  277. +          return 1;
  278. +        }
  279. +
  280. +      /* We differenciate decoding standard UU encoding and base64.  A
  281. +         common function would only slow down the program.  */
  282. +
  283. +      /* For each input line:  */
  284. +      if (do_base64)
  285. +        ret = read_base64 (inname);
  286. +      else
  287. +        ret = read_stduu (inname);
  288. +      if (ret) return ret;
  289. +      first = 0;
  290.      }
  291. -
  292. -  /* We differenciate decoding standard UU encoding and base64.  A
  293. -     common function would only slow down the program.  */
  294. -
  295. -  /* For each input line:  */
  296. -  if (do_base64)
  297. -    return read_base64 (inname);
  298. -  else
  299. -    return read_stduu (inname);
  300.  }
  301.  
  302.  static void
  303. @@ -375,6 +390,7 @@
  304.        printf (_("\
  305.  Mandatory arguments to long options are mandatory to short options too.\n\
  306.    -h, --help               display this help and exit\n\
  307. +  -m, --multiple           decode multiple files if appropriate\n\
  308.    -v, --version            output version information and exit\n\
  309.    -o, --output-file=FILE   direct output to FILE\n"));
  310.      }
  311. @@ -398,7 +414,7 @@
  312.    bindtextdomain (PACKAGE, LOCALEDIR);
  313.    textdomain (PACKAGE);
  314.  
  315. -  while (opt = getopt_long (argc, argv, "ho:v", longopts, (int *) NULL),
  316. +  while (opt = getopt_long (argc, argv, "ho:vm", longopts, (int *) NULL),
  317.       opt != EOF)
  318.      {
  319.        switch (opt)
  320. @@ -410,8 +426,12 @@
  321.        outname = optarg;
  322.        break;
  323.  
  324. +    case 'm':
  325. +      multiple = TRUE;
  326. +      break;
  327. +
  328.      case 'v':
  329. -      printf ("%s - GNU %s %s\n", program_name, PACKAGE, VERSION);
  330. +      printf ("%s - GNU %s %sRTR\n", program_name, PACKAGE, VERSION);
  331.        exit (EXIT_SUCCESS);
  332.  
  333.      case 0:
  334. --- ./src/Makefile.in.orig    Sat Nov 25 16:37:27 1995
  335. +++ ./src/Makefile.in    Mon Apr 28 08:12:46 1997
  336. @@ -31,7 +31,7 @@
  337.  transform = @program_transform_name@
  338.  bindir = $(exec_prefix)/bin
  339.  datadir = $(prefix)/@DATADIRNAME@
  340. -localedir = $(datadir)/locale
  341. +localedir = <installsharedir>/slib/locale
  342.  subdir = src
  343.  
  344.  AR = ar
  345. --- doc/Makefile.in.orig    Fri Nov 24 21:44:35 1995
  346. +++ doc/Makefile.in    Mon Apr 28 09:49:58 1997
  347. @@ -100,14 +100,10 @@
  348.      test -z "$(MAN5PAGES)" || $(top_srcdir)/mkinstalldirs $(man5dir)
  349.      for name in $(MAN1PAGES); do \
  350.        if test $$name = uudecode; then \
  351. -        rm -f $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext); \
  352. -        man1base=`echo $(man1dir) | sed 's@.*/\(.*\)@&1@'`; \
  353. -        echo ".so $$man1base/uuencode$(man1ext)" \
  354. -          > $(man1dir)/`echo uudecode | sed '$(transform)'`$(man1ext); \
  355. -      else \
  356. +        cp $(srcdir)/uuencode.1 $(srcdir)/uudecode.1; \
  357. +      fi; \
  358.          $(INSTALL_DATA) $(srcdir)/$$name.1 \
  359.          $(man1dir)/`echo $$name | sed '$(transform)'`$(man1ext); \
  360. -      fi; \
  361.      done
  362.      test -z "$(MAN5PAGES)" || \
  363.        for name in $(MAN5PAGES); do \
  364.