Skip to content

Commit

Permalink
- Feature-Prod: - add .tar(.gz) archive browsing using libtar/zlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
joke committed Oct 27, 2007
1 parent 6f61792 commit 54cd3c9
Show file tree
Hide file tree
Showing 9 changed files with 1,139 additions and 74 deletions.
27 changes: 18 additions & 9 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
0.6.0:
- feature: - Add a -t option to add files content of .tar archives to the
process of duplicate searching, if zlib is present, .tar.gz
are automatically processed too.

- cosmetic: - Correctly build manpage using automake.

- legal: - LICENSE file added.

0.5.1:
- bugfix: - permissions are now processed correctly when ftwin collect
files and path informations.
Expand All @@ -6,21 +15,21 @@

0.5.0:
- feature: - Add a -I option that switch ftwin into duplicate image
finding, in this mode, ftwin search for image that are copy of
each other, even if they are resized, using libpuzzle.
finding, in this mode, ftwin search for image that are copy of
each other, even if they are resized, using libpuzzle.

0.4.0:
- feature: - Add a whitelisting option, you may want to select files whose
name match a particular regexp for comparison.
For example the following line will report duplicate files
whose extension is .txt and that are not in a .svn directory:
./ftwin -e ".*/\.svn/.*" -w ".*\.txt$" -v -r ${HOME}
name match a particular regexp for comparison.
For example the following line will report duplicate files
whose extension is .txt and that are not in a .svn directory:
./ftwin -e ".*/\.svn/.*" -w ".*\.txt$" -v -r ${HOME}

- bugfix: - mmap checksum mmap is done by block of the same size than
cheksum by read.
The value of checksums were different, now it is the same if
two files are on different type of fs (one mmap-capable, the
other not).
The value of checksums were different, now it is the same if
two files are on different type of fs (one mmap-capable, the
other not).

- bugfix-minor: - Fix a minor memleak by attaching pcre * to an apr_pool.

Expand Down
1 change: 1 addition & 0 deletions KNOWN_BUGS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* A memleak is introduced by using libtar.
678 changes: 678 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ endif

DISTCHECK_CONFIGURE_FLAGS = "--with-apr-config=@apr_config@" "--with-pcre-config=@pcre_config@"

EXTRA_DIST = TODO CHANGES EXAMPLES README docs/ftwin.8 \
check/tests/ check/tests/second check/tests/truerand \
check/tests/copyrand check/tests/testrand
EXTRA_DIST = TODO CHANGES EXAMPLES README LICENSE KNOWN_BUGS \
docs/ftwin.8 check/tests/ check/tests/second \
check/tests/truerand check/tests/copyrand check/tests/testrand

man8_MANS = docs/ftwin.8

## For doxygen building
dox: Doxyfile
Expand All @@ -26,7 +28,7 @@ else
endif

## Define the source files
include_HEADERS = src/debug.h \
noinst_HEADERS = src/debug.h \
src/napr_hash.h \
src/napr_heap.h \
src/checksum.h \
Expand All @@ -50,13 +52,13 @@ ftwin_CFLAGS = @APR_CFLAGS@ @PCRE_CFLAGS@ -Wall -Werror -g -ggdb -I$(top_srcdir)
check_ftwin_CFLAGS = @APR_CFLAGS@ @PCRE_CFLAGS@ -Wall -Werror -g -ggdb -I$(top_srcdir)/src/

# CPPFLAGS is for -I and -D options (involving C preprocessor)
check_ftwin_CPPFLAGS = @CHECK_CFLAGS@ @APR_CPPFLAGS@ @PUZZLE_CPPFLAGS@ -DCHECK_DIR=\"$(top_srcdir)/check\"
ftwin_CPPFLAGS = @APR_CPPFLAGS@ @PUZZLE_CPPFLAGS@
check_ftwin_CPPFLAGS = @CHECK_CFLAGS@ @APR_CPPFLAGS@ @PUZZLE_CPPFLAGS@ @TAR_CPPFLAGS@ @ZLIB_CPPFLAGS@ -DCHECK_DIR=\"$(top_srcdir)/check\"
ftwin_CPPFLAGS = @APR_CPPFLAGS@ @PUZZLE_CPPFLAGS@ @TAR_CPPFLAGS@ @ZLIB_CPPFLAGS@

# LDADD and LIBADD are for linking libraries, -L, -l, -dlopen and -dlpreopen options
check_ftwin_LDADD = @CHECK_LIBS@ @APR_LIBS@ @APU_LIBS@ @PCRE_LIBS@ @PUZZLE_LDADD@
ftwin_LDADD = @APR_LIBS@ @APU_LIBS@ @PCRE_LIBS@ @PUZZLE_LDADD@
check_ftwin_LDADD = @CHECK_LIBS@ @APR_LIBS@ @APU_LIBS@ @PCRE_LIBS@ @PUZZLE_LDADD@ @TAR_LDADD@ @ZLIB_LDADD@
ftwin_LDADD = @APR_LIBS@ @APU_LIBS@ @PCRE_LIBS@ @PUZZLE_LDADD@ @TAR_LDADD@ @ZLIB_LDADD@

# LDFLAGS is for additional linker flags
check_ftwin_LDFLAGS = @PUZZLE_LDFLAGS@
ftwin_LDFLAGS = @PUZZLE_LDFLAGS@
check_ftwin_LDFLAGS = @PUZZLE_LDFLAGS@ @TAR_LDFLAGS@ @ZLIB_LDFLAGS@
ftwin_LDFLAGS = @PUZZLE_LDFLAGS@ @TAR_LDFLAGS@ @ZLIB_LDFLAGS@
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.1
0.6.0
85 changes: 85 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,88 @@ AC_DEFUN([PUZZLE],[
AC_SUBST([PUZZLE_LDFLAGS])
AC_SUBST([PUZZLE_LDADD])
])


#
# libtar is used to compare two images
#
AC_DEFUN([TAR],[
AC_ARG_WITH( tar, AC_HELP_STRING([--with-tar=PATH], [prefix where libtar is installed default=/usr/local/]), [tar=$withval],[tar=/usr/local/])
if test "x$tar" != "x"
then
#
# Make sure we have "libtar.h". If we don't, it means we probably
# don't have libtar, so don't use it.
#
AC_CHECK_HEADER(libtar.h,
[
# Check if the lib is OK
AC_CHECK_LIB(tar, tar_open,
[
AC_DEFINE([HAVE_TAR], 1, [for image comparison mode])
with_tar=yes
TAR_CPPFLAGS="-I$tar/include"
TAR_LDFLAGS="-L$tar/lib"
TAR_LDADD="-ltar"
],
[
with_tar=no
AC_DEFINE([HAVE_TAR], 0, [for image comparison mode])
])
],
[
with_tar=no
AC_DEFINE([HAVE_TAR], 0, [for image comparison mode])
])
else
with_tar=no
AC_DEFINE([HAVE_TAR], 0, [for image comparison mode])
fi
AC_SUBST([with_tar])
AC_SUBST([TAR_CPPFLAGS])
AC_SUBST([TAR_LDFLAGS])
AC_SUBST([TAR_LDADD])
])

#
# libz used to uncompress .tar.gz for the moment.
#
AC_DEFUN([ZLIB],[
AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib=PATH], [prefix where zlib is installed default=/usr]), [zlib=$withval],[zlib=/usr/])
if test "x$zlib" != "x"
then
#
# Make sure we have "zlib.h". If we don't, it means we probably
# don't have libzlib, so don't use it.
#
AC_CHECK_HEADER(zlib.h,
[
# Check if the lib is OK
AC_CHECK_LIB(z, gzread,
[
AC_DEFINE([HAVE_LIBZ], 1, [for image comparison mode])
with_zlib=yes
ZLIB_CPPFLAGS="-I$zlib/include"
ZLIB_LDFLAGS="-L$zlib/lib"
ZLIB_LDADD="-lz"
],
[
with_zlib=no
AC_DEFINE([HAVE_ZLIB], 0, [for image comparison mode])
])
],
[
with_zlib=no
AC_DEFINE([HAVE_ZLIB], 0, [for image comparison mode])
])
else
with_zlib=no
AC_DEFINE([HAVE_ZLIB], 0, [for image comparison mode])
fi
AC_SUBST([with_zlib])
AC_SUBST([ZLIB_CPPFLAGS])
AC_SUBST([ZLIB_LDFLAGS])
AC_SUBST([ZLIB_LDADD])
])
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ PATH_CHECK
# Check libpuzzle
PUZZLE

# Check libtar
TAR

# Check zlib
ZLIB

USER_CFLAGS=$CFLAGS
CFLAGS=""
AC_SUBST(USER_CFLAGS)
Expand All @@ -52,6 +58,8 @@ AC_MSG_RESULT([
** Configuration summary for $PACKAGE $VERSION:
Support for puzzle library: $with_puzzle
Support for tar library: $with_tar
Support for tar library: $with_zlib
])

# Write config.status and the Makefile
Expand Down
21 changes: 8 additions & 13 deletions docs/ftwin.8
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
.\"
.\" Copyright (c) 2007 Francois Pesce <francois.pesce at gmail.com>
.\"
.\" Licensed under the Apache License, Version 2.0 (the "License");
.\" you may not use this file except in compliance with the License.
.\" You may obtain a copy of the License at
.\"
.\" http://www.apache.org/licenses/LICENSE-2.0
.\"
.\" Unless required by applicable law or agreed to in writing, software
.\" distributed under the License is distributed on an "AS IS" BASIS,
.\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.\" See the License for the specific language governing permissions and
.\" limitations under the License.
.\" Copying and distribution of this file, with or without modification,
.\" are permitted in any medium without royalty provided the copyright
.\" notice and this notice are preserved.
.\"
.TH FTWIN "8" "October 2007" "ftwin 0.5.1" "User Commands"
.TH FTWIN "8" "October 2007" "ftwin 0.6.0" "User Commands"
.SH NAME
ftwin \- find duplicate files
.SH SYNOPSIS
Expand Down Expand Up @@ -61,6 +53,9 @@ recurse subdirectories.
\fB\-s\fR, \fB\-\-separator\fR \fIcharacter\fR
separator character between twins, default: \\n.
.TP
\fB\-t\fR, \fB\-\-tar-cmp\fR
will process files archived in .tar(.gz) default: off.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
display a progress indicator.
.TP
Expand Down Expand Up @@ -96,7 +91,7 @@ $ ftwin \-e ".*/\\.svn/.*" \-w ".*\\.txt$" \-v \-r ${HOME}
.SH AUTHOR
Written by Francois Pesce.
.SH "REPORTING BUGS"
Report bugs to PACKAGE_BUGREPORT
Report bugs to francois (dot) pesce (at) gmail (dot) com
.SH COPYRIGHT
Copyright \(co 2007 Francois Pesce
.br
Expand Down
Loading

0 comments on commit 54cd3c9

Please sign in to comment.