1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-06 13:09:50 +00:00

Add `-h' option to force tar to follow symbolic links

This commit is contained in:
Andrew Moore 1994-05-19 18:27:41 +00:00
parent 110af3d672
commit 6a87350c4e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1520
4 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $Id: create.h,v 1.4 1993/09/04 05:06:32 jkh Exp $ */ /* $Id: create.h,v 1.4 1993/09/12 20:45:28 jkh Exp $ */
/* /*
* FreeBSD install - a package for the installation and maintainance * FreeBSD install - a package for the installation and maintainance
@ -32,6 +32,7 @@ extern char *Contents;
extern char *Require; extern char *Require;
extern char *PlayPen; extern char *PlayPen;
extern char *ExcludeFrom; extern char *ExcludeFrom;
extern int Dereference;
void check_list(char *, Package *); void check_list(char *, Package *);
void usage(const char *, const char *, ...); void usage(const char *, const char *, ...);

View File

@ -1,5 +1,5 @@
#ifndef lint #ifndef lint
static const char *rcsid = "$Id: main.c,v 1.5 1994/04/05 14:05:38 jkh Exp $"; static const char *rcsid = "$Id: main.c,v 1.6 1994/04/16 21:50:53 jkh Exp $";
#endif #endif
/* /*
@ -27,6 +27,7 @@ char *Contents = NULL;
char *Require = NULL; char *Require = NULL;
char *PlayPen = NULL; char *PlayPen = NULL;
char *ExcludeFrom = NULL; char *ExcludeFrom = NULL;
int Dereference = 0;
int int
main(int argc, char **argv) main(int argc, char **argv)
@ -87,6 +88,9 @@ main(int argc, char **argv)
break; break;
case 'h': case 'h':
Dereference = 1;
break;
case '?': case '?':
default: default:
usage(prog_name, NULL); usage(prog_name, NULL);
@ -134,6 +138,7 @@ usage(const char *name, const char *fmt, ...)
fprintf(stderr, "-c [-]file Get one-line comment from file (-or arg)\n"); fprintf(stderr, "-c [-]file Get one-line comment from file (-or arg)\n");
fprintf(stderr, "-d [-]file Get description from file (-or arg)\n"); fprintf(stderr, "-d [-]file Get description from file (-or arg)\n");
fprintf(stderr, "-f file get list of files from file (- for stdin)\n"); fprintf(stderr, "-f file get list of files from file (- for stdin)\n");
fprintf(stderr, "-h follow symbolic links\n");
fprintf(stderr, "-i script install script\n"); fprintf(stderr, "-i script install script\n");
fprintf(stderr, "-p arg install prefix will be arg\n"); fprintf(stderr, "-p arg install prefix will be arg\n");
fprintf(stderr, "-k script de-install script\n"); fprintf(stderr, "-k script de-install script\n");

View File

@ -1,5 +1,5 @@
#ifndef lint #ifndef lint
static const char *rcsid = "$Id: perform.c,v 1.6 1993/09/12 20:56:40 jkh Exp $"; static const char *rcsid = "$Id: perform.c,v 1.7 1993/09/18 03:39:20 jkh Exp $";
#endif #endif
/* /*
@ -145,6 +145,8 @@ make_dist(char *home, char *pkg, char *suffix, Package *plist)
sprintf(tball, "%s/%s.%s", home, pkg, suffix); sprintf(tball, "%s/%s.%s", home, pkg, suffix);
if (index(suffix, 'z')) /* Compress/gzip? */ if (index(suffix, 'z')) /* Compress/gzip? */
strcat(args, "z"); strcat(args, "z");
if (Dereference)
strcat(args, "h");
if (Verbose) if (Verbose)
printf("Creating gzip'd tar ball in '%s'\n", tball); printf("Creating gzip'd tar ball in '%s'\n", tball);
strcat(args, "cf"); strcat(args, "cf");

View File

@ -83,6 +83,10 @@ is a
(dash). (dash).
.B "Mandatory." .B "Mandatory."
.TP .TP
.B -h
Forces tar to follow symbolic links, so that the files they point to
are dumped, rather than the links themselves.
.TP
.BI "\-i\ " script .BI "\-i\ " script
Sets Sets
.I script .I script