diff options
author | rillig <rillig@pkgsrc.org> | 2006-08-04 22:46:27 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-08-04 22:46:27 +0000 |
commit | 6d87495379be56e2892bed0df8028c25c99f7e70 (patch) | |
tree | b26bb5452617af16e5a588a3e373b61c9c3f392d /sysutils/same/files | |
parent | 622275fc17bf4d52027c38983371ccf9d0451244 (diff) | |
download | pkgsrc-6d87495379be56e2892bed0df8028c25c99f7e70.tar.gz |
Updated same to 1.8.
Changes unknown.
Diffstat (limited to 'sysutils/same/files')
-rw-r--r-- | sysutils/same/files/Makefile | 17 | ||||
-rw-r--r-- | sysutils/same/files/same.1 | 180 |
2 files changed, 86 insertions, 111 deletions
diff --git a/sysutils/same/files/Makefile b/sysutils/same/files/Makefile index 0cdc53fba11..1ff9289457a 100644 --- a/sysutils/same/files/Makefile +++ b/sysutils/same/files/Makefile @@ -1,15 +1,6 @@ -same_OBJECTS= same.o crc32.o +# $NetBSD: Makefile,v 1.2 2006/08/04 22:46:27 rillig Exp $ -all: same +PROG= same +LDADD= -lz -install: all - ${BSD_INSTALL_PROGRAM} same ${PREFIX}/bin/same - ${BSD_INSTALL_MAN} same.1 ${PREFIX}/man/man1/same.1 - -.c.o: - ${CC} ${CPPFLAGS} ${CFLAGS} -c $< -o $@ - -same: ${same_OBJECTS} - ${CC} ${LDFLAGS} $(same_OBJECTS) ${LIBS} -o $@ - -.PHONY: all install +.include <bsd.prog.mk> diff --git a/sysutils/same/files/same.1 b/sysutils/same/files/same.1 index 00a358dd9a6..2647befe357 100644 --- a/sysutils/same/files/same.1 +++ b/sysutils/same/files/same.1 @@ -1,114 +1,98 @@ -.TH same 1 - -.SH NAME -same \- find identical files and link them to save disk space. - -.SH SYNOPSIS - -\fBsame\fR [-d | --debug] [-hs \fIn\fR | --hashstart \fIn\fR] -[-n | --dryrun] [-s] [-t | --timings] [-v | --verbose] -[-z --nullfiles] - -.SH OPTIONS - -.TP -\fB\-d\fR, \fB\-\-debug\fR -Switch on debugging messages from the program. - -.TP -\fB\-hs\fR \fIn\fR, \fB--hashstart\fR \fIn\fR -Set the start value of the hash function. - -.TP -\fB\-n\fR, \fB\-\-dryrun\fR -Do not modify any file on the disk. - -.TP -\fB\-s\fR -Create symbolic links instead of hard links. - -.TP -\fB\-t\fR, \fB\-\-timings\fR -At the end of the program, output the time needed. - -.TP -\fB\-v\fR, \fB\-\-verbose\fR -Output some messages what is done. - -.TP -\fB\-z\fR, \fB\-\-nullfiles\fR -Even create links for empty files. Normally these files are ignored. - - -.SH INTRODUCTION - -This program takes a list of files (e.g. the output of \fBfind . -type f\fR) -on stdin. Each of the files is compared against each of the -others. Whenever two files are found that match exactly, the two files -are linked (soft or hard) together. - - -.SH GOAL - +.\" $NetBSD: same.1,v 1.2 2006/08/04 22:46:27 rillig Exp $ +.Dd July 14, 2004 +.Dt SAME 1 +.Sh NAME +.Nm same +.Nd link identical files to save disk space +.Sh SYNOPSIS +.Nm +.Fl HVcdhnstuvz +.Sh DESCRIPTION +.Nm +takes a list of files (e.g. the output of find . -type f) on stdin. +Each of the files is compared against each of the others. +Whenever two files are found that match exactly, the two files are +linked (soft or hard) together. +.Ss Goal The goal of this program is to conserve disk space when you have -several different trees of large project on your disk. By creating -hardlinks or softlinks between the files that are the same, you can -save lots of disk space. For example, two different versions of the -Linux kernel only differ in a small number of files. By running this -program you only need to store the contents of those files once. +several different trees of large projects on your disk. +By creating hardlinks or softlinks between the files that are the same, +you can save lots of disk space. +For example, two different versions of the Linux kernel only differ in a +small number of files. +By running this program you only need to store the contents of those +files once. This is especially useful if you have different versions of complete -trees lying around. - -.SH IMPLEMENTATION - +trees lying around. +.Ss Implementation The filesize of every file is used as an indication of wether two files can be the same. Whenever the filesizes match, the hashes of these two files are compared. Whenever these match, the file contents are compared. For every matching pair one of the two files is replaced by a hard link to the other file. -With the \fB-s\fR option a softlink is used. - +With the -s option a softlink is used. +.Pp To allow you to do this incrementally, the "rm" is done on the file with the least links. This allows you to "merge" a new tree with several trees that have already been processed. The new tree has link count 1, while the old tree has a higher link count for those files that are likely candidates for linkage. - +.Pp The current implementation keeps the "first" incantation of a file, and replaces further occurrances of the same file. This is -significant when using softlinks. - -.SH EXAMPLE - -.TP -\fBfind . -type f | same\fR - -This links all files together under the current directory that are -the same. - -.SH BUGS - -.IP \(bu -Make sure that you have all the permissions required for -execution of the commands. - -.IP \(bu -RCS probably allows you to do similar things. - -.IP \(bu +significant when using softlinks. +.Ss Options +.Bl -tag -width xxxxxx +.It Fl H Ar n , Fl -hashstart Ar n +Start at hash value +.Ar n +instead of 0. +.It Fl V , Fl -version +Print the version of the program and exit. +.It Fl c Ar file , Fl -cache Ar file +Keep a cache between runs in file +.Ar file . +.It Fl d , Fl -debug +Output some debug messages. +.It Fl h , Fl -help +Output this page and exit successfully. +.It Fl n , Fl -dryrun +Only simulate. +.It Fl s , Fl -softlinks +Create soft links instead of hard links. +.It Fl u , Fl -user +Don't relink files owned by another user. +.It Fl v , Fl -verbose +Output verbose messages. +.It Fl z , Fl -nullfiles +Link empty files, too. +By default, only non-empty files are linked. +.El +.Sh EXIT STATUS +Zero on success, non-zero on failure. +.Sh EXAMPLES +.Bd -literal +find . -type f -print | same +.Ed +.Sh SEE ALSO +.Xr find 1 +.Sh AUTHORS +.An "Roger E. Wolff" Aq R.E.Wolff@BitWizard.nl , +.An "Geert Uytterhoeven" Aq geert@linux-m68k.org , +.An "Roland Illig" Aq roland.illig@gmx.de . +.Sh CAVEATS +.Bl -bullet +.It If your editor does not move the original aside before writing a new copy, you will change the file in ALL incarnations when -editing a file. Patch works just fine: it moves the original -aside before creating a new copy. I'm confident that I could -learn Emacs to do it this way too. I'm too lazy to figure it out, -so if you happen to know an easy way how to do this, please Email -me at R.E.Wolff@BitWizard.nl - -.IP \(bu -There is a 1024 character limit to pathnames when using symlinks. - -.SH AUTHOR - -This manpage was written by Roland Illig <roland.illig@gmx.de> for the -pkgsrc distribution. Some sections are taken from the source code of -`same'. +editing a file. +Patch works just fine: it moves the original aside before creating a new +copy. +I'm confident that I could learn Emacs to do it this way too. +I'm too lazy to figure it out, so if you happen to know an easy way how +to do this, please Email me at +.Aq R.E.Wolff@BitWizard.nl . +.It +There is a 1024 (BUFSIZE) character limit to pathnames when using +symlinks. +.El |