Copyright (C) 2000-2012 |
Manpages TARCUSTSection: A tar Customizer (1)Updated: tarcust 0.9.0 (16-Sep-2001) Index Return to Main Contents NAMEtarcust - a tar customizerSYNOPSIStarcust [-h, -help] [-V, -version] [-v, -verbose] [-D, -force-directory] [-u, -owner=NAME, -user-name=NAME] [-U, -user-number=NUMBER] [-g, -group=NAME, -group-name=NAME] [-G, -group-number=NUMBER] [-p, -prefix=DIR[:MODE]] [-s, -transform-name=EXPR] [-x, -exclude=EXPR] [-a, -applies-to=EXPR] [-e, -eval=EXPR] [-B, -begin-eval=EXPR] [-E, -end-eval=EXPR] [input.tar [output.tar]]DESCRIPTIONThe tarcust program has been written to help developers building distributions of their programs. The great automake GNU tool provides an easy way, just type `"make dist"' and your package is ready to distribute. But if for some reason you do not use this tool, it may be a pain.The tarcust script has been designed to provide a portable way to implement nice features missing in standard UNIX tar, like deletion of files, manipulation of owner/group of files, changes in names. GNU tar has such features, so tarcust may seem useless in this case, but remember it has been designed to work with any UNIX system. OPTIONS
ARGUMENTSYou may specify input and output filenames on command-line. By default datas are read on standard input and sent to standard output. As with most Unix commands, an hyphen is equivalent to standard input or standard output.EXAMPLESPrepends a prefix to each file name, the new directory has mode permissions set to 775
cat MANIFEST | xargs tar cf - \ | tarcust --prefix=myprog-0.3:775 \ | gzip -c > myprog-0.3.tar.gzThis rule in your Makefile will build a distribution without the need of a MANIFEST file, ignoring all CVS files
dist: distclean find . -type f -a ! -name myprog-0.3.tar.gz \ | xargs tar cf - \ | tarcust -x '.*CVS.*' -x '.*\.cvsignore' \ | gzip -9 -c > myprog-0.3.tar.gzOr with GNU tar
dist: distclean find * -depth -print | sort \ | xargs tar --no-recursion -cf - |\ | tarcust -x '.*CVS.*' -x '.*\.cvsignore' \ | gzip -9 -c > myprog-0.3.tar.gzTo satisfy your egocentric feelings, try this one
dist: cat MANIFEST | xargs tar cf - \ | tarcust -u Denis -g Barbier | gzip -9 -c > myprog-0.3.tar.gzChange every filename in uppercase letters and suppress any suffix
dist: cat MANIFEST | xargs tar cf - \ | tarcust -s tr[a-z][A-Z] -s 's,\.[^/]*$,,' \ | gzip -9 -c > myprog-0.3.tar.gzMake all files with a ".pl" suffix executable:
cat MANIFEST | xargs tar cf - \ | tarcust -e '$F{name}=~/\.pl$/ && ($F{mode} |= oct 111)' \ | gzip -9 -c > myprog-0.3.tar.gzPrint how many directories have been written into archive
cat MANIFEST | xargs tar cf - \ | tarcust -B '$cnt=0' -e '$cnt++ if $F{typeflag} == 5' \ -E 'printf STDERR "# directories: %d\n", $cnt' \ | gzip -9 -c > myprog-0.3.tar.gz NOTESUnlike tar and tardy, tarcust does not perform checks on user and group informations. And it never will, unless a kind guy explain me the benefits of taking care of those informations when distributing a tarball worldwide.
String manipulations may look strange at the first glance. To understand
how it works, remember that:
There is one point i have to mention : when excluding files, the regular expression must exactly match file names, in other words the regexp you type is surrounded by "^" and "$". LIMITATIONSGNU implementation does not follow POSIX specifications about file names longer than 100 characters. Current "tarcust" version do know how to deal with filenames < 512 chars with GNU implementation. Further releases should support both GNU and POSIX standards.For portability reasons, directories are put in the archive to make sure they exist when files are extracted. So when you apply a transformation on file names which move them to another directory, you have to ensure that directories are updated too. The -prefix option will automatically insert directories, but not -transform-names. HISTORYThe tarcust program is strongly inspired by tardy, a tar post-processor written in C by Peter Miller. I realized that a tarfile is just a formatted text, so Perl should be a nice tool to manipulate it. On CPAN, i found the Archive::Tar module by Calle Dybedahl, Gurusamy Sarathy and Stephen Zander.
But this module is more a Perl replacement for tar than a
post-processor. So i wrote my own Perl script to follow these goals:
When writing tarcust, i tried to be compatible with existing softwares, it's why option names are taken from tardy or tar. SEE ALSOtar(1) tardy(1) Archive::Tar(3)AUTHORDenis Barbier barbier@engelschall.com http://www.engelschall.com/sw/tarcust/CREDITSJohn Midgley "<jmidgley@labyrinth.net.au>" suggested the -s and -e flags which make tarcust much more powerful.
Index
This document was created by man2html, using the manual pages. Time: 20:49:09 GMT, November 13, 2024 |