tarfix





SYNOPSIS

     tarfix -[acnm] [-s N] [-f msdos or vms] [-t msdos or v7]


DESCRIPTION

     Tarfix is a filter used to fix and convert tar(5) archives.
     Without any options tarfix reads a tape archive from stan-
     dard input and prints it on standard output fixing any wrong
     checksums found.  This is useful after editing a tape
     archive using a binary editor.


OPTIONS

     -a   Fix an archive containing absolute filenames.  The
          leading / from every filename is removed.

     -c   Create canonical filenames.  Any relative parts in a
          file name like /../, /./ and // are removed.  Note that
          // is interpreted as the root directory.

     -n   Do not perform the conversion on a tape archive.  A
          list of filenames will be read from the standard input,
          will be converted as specified by other options and
          will be printed on standard output.  This is useful for
          creating shell scripts to perform the conversion or for
          dealing with other archiving programs.

     -m   Print a map of all filenames converted on standard
          error.  Such a map is needed when trying to decipher
          what each filename used to be called, in order to fix
          makefiles etc.

     -s N Shorten all filename components in the archive to
          length N.  The shortening algorithm is discussed later.

     -f msdos
          Assume that the archive to be converted comes from an
          MS-DOS system.  The following conversions will be per-
          formed:

          + All backslashes will be converted to slashes.

          + Uppercase characters will be converted to lowercase.

          + A leading drive name followed by a colon will be
          removed.

     -f vms
          Assume that the archive to be converted comes from a
          VMS system.  The following conversions will be per-
          formed:

          + Uppercase characters will be converted to lowercase.

          + A directory name of the form [xxxx] will be converted
          to xxxx/.

          + A trailing semicolon followed by a generation number
          will be removed.

          + Double quotes and ^V characters will be removed.

     -t msdos
          Convert the archive to MS-DOS conventions.  The follow-
          ing conversions will be performed:

          + Each filename component will have all the dots, but
          one removed to convert it to a name followed by an
          optional extension.

          + The name will be shortened to 8 characters.

          + The extension will be shortened to three characters.

          + Any one of the ``,=+<>|; *?:[]\"'' characters will be
          converted to a ``^''.

          + If a name is any of the device names con, aux1, aux2,
          aux3, aux4, prn, clock$, lpt1, lpt2 or lpt3 it will
          have an underline prepended to it.

     -t v7
          Convert the archive to the seventh edition Unix naming
          conventions.  All components of a filename will be
          shortened to 14 characters.

     Only one of the conversion options should be given.  All
     conversions create canonical file names.

     Tarfix tries quite hard to retain meaningful filenames when
     it shortens them.  The shortening algorithm is a many pass
     one, on each pass less meaning from the filename is
     preserved. All transformations are done starting from the
     end of the name and moving towards the beginning.  First a
     series of phonetic transformations are prerformed.  Double
     letters are removed and the pairs ou, ck, ks, sh, ph and oo
     are substituted with u, k, x, s, f and u respectively.  If
     this procedure does not produce a short enough filename then
     vowels will start getting removed, first lowercase, then
     uppercase.  Finally the string is trimmed by removing
     extraneous characters from its end.

     Tarfix remembers all the filenames converted and will not
     map two different filenames to the same one.  The letters AA
     will be appended to dublicate filename components created
     and these will be inscremented with every name clash.
     file system (e.g. Minix).  At the end, the file map will
     contain a list of filenames as they were in the archive and
     the name with which each was extracted.

     ``find . -print | tarfix -s 12 -n | sed -e 's/^/mv /' | sh''
     converts all filenames in a directory hierarchy to use up to
     12 characters.

     ``tar cf uupc | tarfix -t msdos >/dev/rmt8'' will create a
     tape archive that can be easily extracted on an MS-DOS sys-
     tem.


AUTHOR

     Diomidis Spinellis <dds@cc.ic.ac.uk>


SEE ALSO

     tar(1), tar(5), dd(1), find(1), cpio(1)


DIAGNOSTICS

     Will complain if it can not read the a header or data block
     of an archive.


BUGS

     This is a beta release.  More extensive testing is needed.

     It is assumed that the filenames are written in English.

     The author has never in his life seen a tape archive created
     on VMS.

     Not the fastest program around, but the price is right.


Man(1) output converted with man2html