[Reproducible-commits] [rdfind] 05/06: Imported Upstream version 1.3.3
Reiner Herrmann
reiner at reiner-h.de
Sun Aug 16 19:52:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch upstream
in repository rdfind.
commit 0618131f7c9a72d17e58cf5517885bc12cb71258
Author: TANIGUCHI Takaki <takaki at asis.media-as.org>
Date: Tue Jun 18 23:03:00 2013 +0900
Imported Upstream version 1.3.3
---
ChangeLog | 22 ++++-
Dirlist.cc | 5 +-
Fileinfo.cc | 24 ++---
Fileinfo.hh | 16 +--
Makefile.am | 5 +-
Makefile.in | 109 +++++++++++++++++++--
Rdutil.cc | 27 ++++--
Rdutil.hh | 15 +--
config.h.in | 6 ++
configure | 220 ++++++++++++++++++++++++++++++++++++++++--
configure.in | 11 ++-
rdfind.1 | 10 +-
rdfind.cc | 9 +-
testcases/largefilesupport.sh | 54 +++++++++++
14 files changed, 461 insertions(+), 72 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a64dc63..bbf767b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,27 @@
+2013-06-18 Paul Dreik <rdfind at pauldreik.se>
+ * release of 1.3.3
+ now builds on GNU/Hurd (see debian bug #711793) using the patch by
+ Pino Toscano. Thanks!
+ large file problem on 32 bit solved.
+2013-06-03 Paul Dreik <rdfind at pauldreik.se>
+ * applied patch for building on GNU/Hurd, by Pino Toscano
+2013-01-31 Paul Dreik <rdfind at pauldreik.se>
+ * added testing. currently the only test is to verify that the
+ large file problem is solved.
+2013-01-26 Paul Dreik <rdfind at pauldreik.se>
+ * prerelease of 1.3.3
+ * working with large file problems on 32 bit ubuntu,
+ with large files being ignored by rdfind due to lstat
+ returning error. There are also printing problems
+ reporting total file size on stdout when running which
+ hopefully are solved now.
2012-11-27 Paul Dreik <rdfind at pauldreik.se>
* corrected typo in manpage example, which incorrectly used
-deletefiles instead of -deleteduplicates. Thanks KC for reporting
this!
* release of 1.3.2
-
2012-05-07 Paul Dreik <rdfind at pauldreik.se>
-
* release of 1.3.1. No changes except the gcc 4.7 related changes.
-
2012-04-19 Paul Dreik <rdfind at pauldreik.se>
* now compiles with gcc 4.7
2011-07-24 Paul Dreik <rdfind at pauldreik.se>
@@ -115,4 +129,4 @@
2006-01-05 Paul Sundvall <rdfind at paulsundvall.net>
*started. first version.
- CHANGELOG $Revision: 798 $
+ CHANGELOG $Revision: 824 $
diff --git a/Dirlist.cc b/Dirlist.cc
index 39ccdf7..1db6c56 100644
--- a/Dirlist.cc
+++ b/Dirlist.cc
@@ -3,9 +3,10 @@ files for reading entries from a file structure.
Author Paul Sundvall 2006
see LICENSE for details.
-$Revision: 561 $
-$Id: Dirlist.cc 561 2009-01-21 16:34:00Z pauls $
+$Revision: 803 $
+$Id: Dirlist.cc 803 2013-01-26 04:22:16Z paul $
*/
+#include "config.h"
#include "Dirlist.hh"
#include <dirent.h>
#include <sys/types.h>
diff --git a/Fileinfo.cc b/Fileinfo.cc
index b411f47..fcb725d 100644
--- a/Fileinfo.cc
+++ b/Fileinfo.cc
@@ -2,12 +2,12 @@
a class to hold information about a file.
cvs info:
-$Revision: 765 $
-$Id: Fileinfo.cc 765 2012-04-19 20:05:09Z pauls $
+$Revision: 822 $
+$Id: Fileinfo.cc 822 2013-06-03 09:25:13Z paul $
Author Paul Sundvall 2006
See LICENSE for details.
*/
-
+#include "config.h"
#include "Fileinfo.hh"
#include <fstream>//for file reading
@@ -110,18 +110,18 @@ bool Fileinfo::readfileinfo(){
} while(res<0 && errno==EINTR);
if (res<0){
- m_info.st_size=0;
- m_info.st_ino=0;
- m_info.st_dev=0;
+ m_info.stat_size=0;
+ m_info.stat_ino=0;
+ m_info.stat_dev=0;
std::cerr<<"readfileinfo.cc:Something went wrong when reading file info from \""<<
m_filename<<"\" :"<<strerror(errno)<<std::endl;
return false;
}
//only keep the relevant information
- m_info.st_size=(Fileinfo::filesizetype) info.st_size;
- m_info.st_ino= info.st_ino;
- m_info.st_dev= info.st_dev;
+ m_info.stat_size=(Fileinfo::filesizetype) info.st_size;
+ m_info.stat_ino= info.st_ino;
+ m_info.stat_dev= info.st_dev;
m_info.is_file=S_ISREG(info.st_mode)?true:false;
m_info.is_directory=S_ISDIR(info.st_mode)?true:false;
@@ -149,9 +149,9 @@ const std::string Fileinfo::getduptypestring(const Fileinfo &A) {
//constructor
Fileinfo::Fileinfostat::Fileinfostat() {
- st_size=99999;
- st_ino =99999;
- st_dev =99999;
+ stat_size=99999;
+ stat_ino =99999;
+ stat_dev =99999;
is_file =false;
is_directory=false;
}
diff --git a/Fileinfo.hh b/Fileinfo.hh
index a4abe59..c9f2dc3 100644
--- a/Fileinfo.hh
+++ b/Fileinfo.hh
@@ -3,8 +3,8 @@ a class to hold information about a file.
Author Paul Sundvall 2006
see LICENSE for details.
-$Revision: 765 $
-$Id: Fileinfo.hh 765 2012-04-19 20:05:09Z pauls $
+$Revision: 822 $
+$Id: Fileinfo.hh 822 2013-06-03 09:25:13Z paul $
*/
#ifndef Fileinfo_hh
@@ -67,9 +67,9 @@ public:
//to store info about the file
typedef off_t filesizetype; //defined in sys/types.h
struct Fileinfostat {
- filesizetype st_size;//size
- unsigned long st_ino;//inode
- unsigned long st_dev;//device
+ filesizetype stat_size;//size
+ unsigned long stat_ino;//inode
+ unsigned long stat_dev;//device
bool is_file;
bool is_directory;
Fileinfostat();
@@ -142,16 +142,16 @@ public:
static bool static_deleteflag(const Fileinfo &A){return A.deleteflag();}
//returns the size
- filesizetype size() const {return m_info.st_size;}
+ filesizetype size() const {return m_info.stat_size;}
//returns true if A has size zero
static bool isempty(const Fileinfo &A){return A.size()==0;}
//returns the inode number
- unsigned long inode() const {return m_info.st_ino;}
+ unsigned long inode() const {return m_info.stat_ino;}
//returns the device
- unsigned long device() const {return m_info.st_dev;}
+ unsigned long device() const {return m_info.stat_dev;}
//gets the filename
const std::string& name() const {return m_filename;}
diff --git a/Makefile.am b/Makefile.am
index 5727038..cbfd490 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,10 @@
AUTOMAKE_OPTIONS = gnu # I would like dist-bzip2 here, but automake complains
bin_PROGRAMS = rdfind
rdfind_SOURCES = rdfind.cc Checksum.cc Dirlist.cc Fileinfo.cc Rdutil.cc
-EXTRA_DIST = algos.hh Dirlist.hh MultiAttributeCompare.hh Checksum.hh Fileinfo.hh Rdutil.hh rdfind.1 bootstrap.sh RdfindDebug.hh
+TESTS=testcases/*.sh
+EXTRA_DIST = algos.hh Dirlist.hh MultiAttributeCompare.hh Checksum.hh Fileinfo.hh Rdutil.hh rdfind.1 bootstrap.sh RdfindDebug.hh $(TESTS)
man_MANS = rdfind.1
+
+
diff --git a/Makefile.in b/Makefile.in
index aa325c2..7b171a2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -97,6 +97,8 @@ NROFF = nroff
MANS = $(man_MANS)
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -204,7 +206,8 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = gnu # I would like dist-bzip2 here, but automake complains
rdfind_SOURCES = rdfind.cc Checksum.cc Dirlist.cc Fileinfo.cc Rdutil.cc
-EXTRA_DIST = algos.hh Dirlist.hh MultiAttributeCompare.hh Checksum.hh Fileinfo.hh Rdutil.hh rdfind.1 bootstrap.sh RdfindDebug.hh
+TESTS = testcases/*.sh
+EXTRA_DIST = algos.hh Dirlist.hh MultiAttributeCompare.hh Checksum.hh Fileinfo.hh Rdutil.hh rdfind.1 bootstrap.sh RdfindDebug.hh $(TESTS)
man_MANS = rdfind.1
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -415,6 +418,99 @@ GTAGS:
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ fi; \
+ echo "$${col}$$dashes$${std}"; \
+ echo "$${col}$$banner$${std}"; \
+ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+ test -z "$$report" || echo "$${col}$$report$${std}"; \
+ echo "$${col}$$dashes$${std}"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
@@ -591,6 +687,7 @@ distcleancheck: distclean
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS) config.h
installdirs:
@@ -701,12 +798,12 @@ uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
-.MAKE: all install-am install-strip
+.MAKE: all check-am install-am install-strip
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
- dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
- dist-zip distcheck distclean distclean-compile \
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
+ clean clean-binPROGRAMS clean-generic ctags dist dist-all \
+ dist-bzip2 dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ \
+ dist-xz dist-zip distcheck distclean distclean-compile \
distclean-generic distclean-hdr distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-binPROGRAMS install-data \
diff --git a/Rdutil.cc b/Rdutil.cc
index f3ac9f8..6099bc2 100644
--- a/Rdutil.cc
+++ b/Rdutil.cc
@@ -4,10 +4,13 @@ functionality in rdfind.
Author Paul Sundvall 2006
see LICENSE for details.
-$Revision: 719 $
-$Id: Rdutil.cc 719 2011-07-24 12:17:18Z pauls $
+$Revision: 803 $
+$Id: Rdutil.cc 803 2013-01-26 04:22:16Z paul $
*/
+#include "config.h"
+
#include "Rdutil.hh"
+#include <cassert>
#include <fstream> //for file writing
#include <ostream> //for output
#include <string> //for easier passing of string arguments
@@ -217,18 +220,24 @@ int Rdutil::remove_if()
//total size
//opmode=0 just add everything
//opmode=1 only elements with m_duptype=Fileinfo::DUPTYPE_FIRST_OCCURRENCE
-unsigned long long Rdutil::totalsizeinbytes(int opmode)
+unsigned long long Rdutil::totalsizeinbytes(int opmode) const
{
//for some reason, for_each does not work.
Rdutil::adder_helper adder;
std::vector<Fileinfo>::iterator it;
- if(opmode==0)
- for(it=m_list.begin();it!=m_list.end();++it)
- adder(*it);
- else if(opmode==1)
- for(it=m_list.begin();it!=m_list.end();++it)
- if(it->getduptype()==Fileinfo::DUPTYPE_FIRST_OCCURRENCE)
+ if(opmode==0) {
+ for(it=m_list.begin();it!=m_list.end();++it) {
+ adder(*it);
+ }
+ } else if(opmode==1) {
+ for(it=m_list.begin();it!=m_list.end();++it) {
+ if(it->getduptype()==Fileinfo::DUPTYPE_FIRST_OCCURRENCE) {
adder(*it);
+ }
+ }
+ } else {
+ assert(!"bad input, mode should be 0 or 1");
+ }
return adder.getsize();
}
diff --git a/Rdutil.hh b/Rdutil.hh
index cef9526..0a53868 100644
--- a/Rdutil.hh
+++ b/Rdutil.hh
@@ -4,8 +4,8 @@ functionality in rdfind.
Author Paul Sundvall 2006
see LICENSE for details.
-$Revision: 719 $
-$Id: Rdutil.hh 719 2011-07-24 12:17:18Z pauls $
+$Revision: 803 $
+$Id: Rdutil.hh 803 2013-01-26 04:22:16Z paul $
*/
#ifndef rdutil_hh
#define rdutil_hh
@@ -101,15 +101,18 @@ public:
class adder_helper {
public:
adder_helper() : m_sum(0) {};
- unsigned long long int m_sum;
- void operator()(const Fileinfo &A) {m_sum+=A.size();}
- unsigned long long int getsize(void) const {return m_sum;}
+ typedef unsigned long long int sizetype_t;
+ sizetype_t m_sum;
+ void operator()(const Fileinfo &A) {
+ m_sum+=static_cast<sizetype_t>(A.size());
+ }
+ sizetype_t getsize(void) const {return m_sum;}
};
//gets the total size, in bytes.
//opmode=0 just add everything
//opmode=1 only elements with m_duptype=Fileinfo::DUPTYPE_FIRST_OCCURRENCE
- unsigned long long int totalsizeinbytes(int opmode=0);
+ unsigned long long int totalsizeinbytes(int opmode=0) const;
//outputs a nicely formatted string "45 bytes" or "3 Gibytes"
//where 1024 is used as base
diff --git a/config.h.in b/config.h.in
index 4749c1f..60c5cc0 100644
--- a/config.h.in
+++ b/config.h.in
@@ -71,3 +71,9 @@
/* Version number of package */
#undef VERSION
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
diff --git a/configure b/configure
index b5d1cd5..a3aac2f 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for rdfind.cc 1.3.2.
+# Generated by GNU Autoconf 2.68 for rdfind.cc 1.3.3.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -557,8 +557,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rdfind.cc'
PACKAGE_TARNAME='rdfind-cc'
-PACKAGE_VERSION='1.3.2'
-PACKAGE_STRING='rdfind.cc 1.3.2'
+PACKAGE_VERSION='1.3.3'
+PACKAGE_STRING='rdfind.cc 1.3.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -694,6 +694,7 @@ ac_user_opts='
enable_option_checking
enable_dependency_tracking
enable_debug
+enable_largefile
'
ac_precious_vars='build_alias
host_alias
@@ -1249,7 +1250,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures rdfind.cc 1.3.2 to adapt to many kinds of systems.
+\`configure' configures rdfind.cc 1.3.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1315,7 +1316,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of rdfind.cc 1.3.2:";;
+ short | recursive ) echo "Configuration of rdfind.cc 1.3.3:";;
esac
cat <<\_ACEOF
@@ -1326,6 +1327,7 @@ Optional Features:
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--enable-debug enable debug printouts in program (default=no)
+ --disable-largefile omit support for large files
Some influential environment variables:
CC C compiler command
@@ -1405,7 +1407,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-rdfind.cc configure 1.3.2
+rdfind.cc configure 1.3.3
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1808,7 +1810,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by rdfind.cc $as_me 1.3.2, which was
+It was created by rdfind.cc $as_me 1.3.3, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2626,7 +2628,7 @@ fi
# Define the identity of the package.
PACKAGE=rdfind
- VERSION=1.3.2
+ VERSION=1.3.3
cat >>confdefs.h <<_ACEOF
@@ -4652,6 +4654,204 @@ fi
done
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_cxx_try_compile "$LINENO"; then :
+ break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_file_offset_bits=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_sys_large_files=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+ fi
+fi
+
@@ -5195,7 +5395,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by rdfind.cc $as_me 1.3.2, which was
+This file was extended by rdfind.cc $as_me 1.3.3, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5261,7 +5461,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-rdfind.cc config.status 1.3.2
+rdfind.cc config.status 1.3.3
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.in b/configure.in
index 68b7355..3cf87ba 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,10 @@
-dnl configure.in for rdfind. Written By Paul Sundvall.
-dnl This file is cvs version $Revision: 798 $
+dnl configure.in for rdfind.
-VERSION="1.3.2"
-AC_INIT(rdfind.cc,1.3.2)
+VERSION="1.3.3"
+AC_INIT(rdfind.cc,1.3.3)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(rdfind,1.3.2)
+AM_INIT_AUTOMAKE(rdfind,1.3.3)
dnl find and test the C compiler
@@ -61,6 +60,8 @@ AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
AC_CHECK_HEADERS(time.h,,AC_MSG_WARN(nanosleep header time.h missing?))
+dnl check for 64 bit support
+AC_SYS_LARGEFILE
AC_SUBST(VERSION)
diff --git a/rdfind.1 b/rdfind.1
index 3675d68..86904c4 100644
--- a/rdfind.1
+++ b/rdfind.1
@@ -3,9 +3,9 @@
.\"
.\" Author Paul Dreik 2006
.\" see LICENSE for details.
-.\" $Revision: 798 $
-.\" $Id: rdfind.1 798 2012-11-27 19:52:04Z paul $
-.TH rdfind "1" 1.3.2 "Nov 2012" rdfind
+.\" $Revision: 824 $
+.\" $Id: rdfind.1 824 2013-06-18 10:43:10Z paul $
+.TH rdfind "1" 1.3.3 "Jun 2013" rdfind
.SH NAME
rdfind \- finds duplicate files
.SH SYNOPSIS
@@ -150,8 +150,8 @@ Several persons have helped with suggestions and improvements:
Niels Möller, Carl Payne and Salvatore Ansani. Thanks also to you
who tested the program and sent me feedback.
.SH VERSION
-1.3.2 (release date 2012-11-27)
-svn id: $Id: rdfind.1 798 2012-11-27 19:52:04Z paul $
+1.3.3 (release date 2013-06-18)
+svn id: $Id: rdfind.1 824 2013-06-18 10:43:10Z paul $
.SH COPYRIGHT
This program is distributed under GPLv2 or later, at your option.
.SH "SEE ALSO"
diff --git a/rdfind.cc b/rdfind.cc
index 5e48f48..89d6df6 100644
--- a/rdfind.cc
+++ b/rdfind.cc
@@ -3,8 +3,8 @@
copyright Paul Dreik (earlier Sundvall)
see LICENSE for details.
- $Revision: 767 $
- $Id: rdfind.cc 767 2012-05-07 17:35:41Z pauls $
+ $Revision: 803 $
+ $Id: rdfind.cc 803 2013-01-26 04:22:16Z paul $
version info:
@@ -12,6 +12,7 @@
*/
+#include "config.h"
#include <iostream>//cout etc
#include <vector>
@@ -105,8 +106,8 @@ void usage()
cout<<endl;
cout<<endl
<<"rdfind is written by Paul Dreik 2006. License: GPL v2 or later (at your option)."<<endl;
- cout<<"svn version of this file is $Revision: 767 $"<<endl;
- cout<<"svn id of this file is $Id: rdfind.cc 767 2012-05-07 17:35:41Z pauls $"<<endl;
+ cout<<"svn version of this file is $Revision: 803 $"<<endl;
+ cout<<"svn id of this file is $Id: rdfind.cc 803 2013-01-26 04:22:16Z paul $"<<endl;
cout<<"version is "<<VERSION<<endl;
cout<<endl;
}
diff --git a/testcases/largefilesupport.sh b/testcases/largefilesupport.sh
new file mode 100755
index 0000000..1ea2276
--- /dev/null
+++ b/testcases/largefilesupport.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+#This makes sure we can handle files bigger than 2^32-1 bytes
+
+rdfind=$(pwd)/rdfind
+
+#bail out on the first error
+set -e
+
+dbgecho() {
+ echo "$0 debug: " "$@"
+}
+
+echo -n "checking for rdfind ..." && [ -x $rdfind ] && echo " OK."
+echo -n "checking for mktemp ..." && [ -x mktemp ] && echo " OK."
+
+#create a temporary directory, which is automatically deleted
+#on exit
+datadir=$(mktemp --tmpdir=/tmp -d rdfindtestcases.d.XXXXXXXXXXXX)
+dbgecho "temp dir is $datadir"
+
+cleanup () {
+cd /
+rm -rf $datadir
+}
+
+trap cleanup 0
+
+[ -d $datadir ]
+cd $datadir
+
+#create a large file, sparse.
+filesize=$((2147483647+1)) #size, in bytes. This is a problematic value.
+
+#make two files, which differ at the first byte to make
+#rdfind return fast after comparing the initial part.
+echo "a">sparse-file1
+echo "b">sparse-file2
+dd if=/dev/null of=sparse-file1 bs=1 seek=$filesize count=1
+dd if=/dev/null of=sparse-file2 bs=1 seek=$filesize count=1
+#let the filesystem settle
+sync
+
+#now run rdfind on the local files. Move them to a subdir
+#To prevent rdfind from reading its result file or rdfind.out
+mkdir subdir
+mv sparse-file* subdir
+$rdfind subdir 2>&1 |tee rdfind.out
+dbgecho "rdfind ran ok."
+
+#make sure rdfind.out contains the right size
+grep -q "^Total size is $((filesize*2)) bytes" rdfind.out
+
+#make sure none could be reduced
+grep -q "^It seems like you have 0 files that are not unique$" rdfind.out
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/rdfind.git
More information about the Reproducible-commits
mailing list