summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2009-06-20 13:55:19 +0000
committerPeter Volkov <pva@gentoo.org>2009-06-20 13:55:19 +0000
commitb0e8c728985345b6273217a6009b5ecf5e89bf62 (patch)
tree7db040f9333471c86602ddeba3ce5ec55ffbc911 /app-misc/fdupes
parentStable for HPPA (bug #274666). (diff)
downloadgentoo-2-b0e8c728985345b6273217a6009b5ecf5e89bf62.tar.gz
gentoo-2-b0e8c728985345b6273217a6009b5ecf5e89bf62.tar.bz2
gentoo-2-b0e8c728985345b6273217a6009b5ecf5e89bf62.zip
Fixed another regression cause by md5sum-external USE flag, bug #273597, thank Sven Wehner for detailed report.
(Portage version: 2.2_rc33/cvs/Linux i686)
Diffstat (limited to 'app-misc/fdupes')
-rw-r--r--app-misc/fdupes/ChangeLog9
-rw-r--r--app-misc/fdupes/fdupes-1.40-r4.ebuild40
-rw-r--r--app-misc/fdupes/files/fdupes-1.40-external-md5sum-quotation-1.patch72
3 files changed, 120 insertions, 1 deletions
diff --git a/app-misc/fdupes/ChangeLog b/app-misc/fdupes/ChangeLog
index 9c76dd0dff4e..a2506a6bd306 100644
--- a/app-misc/fdupes/ChangeLog
+++ b/app-misc/fdupes/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-misc/fdupes
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/fdupes/ChangeLog,v 1.28 2009/06/16 18:07:05 klausman Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/fdupes/ChangeLog,v 1.29 2009/06/20 13:55:18 pva Exp $
+
+*fdupes-1.40-r4 (20 Jun 2009)
+
+ 20 Jun 2009; Peter Volkov <pva@gentoo.org> +fdupes-1.40-r4.ebuild,
+ +files/fdupes-1.40-external-md5sum-quotation-1.patch:
+ Fixed another regression cause by md5sum-external USE flag, bug #273597,
+ thank Sven Wehner for detailed report.
16 Jun 2009; Tobias Klausmann <klausman@gentoo.org> fdupes-1.40-r3.ebuild:
Keyworded on alpha, bug #272785
diff --git a/app-misc/fdupes/fdupes-1.40-r4.ebuild b/app-misc/fdupes/fdupes-1.40-r4.ebuild
new file mode 100644
index 000000000000..c9250372b349
--- /dev/null
+++ b/app-misc/fdupes/fdupes-1.40-r4.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/fdupes/fdupes-1.40-r4.ebuild,v 1.1 2009/06/20 13:55:18 pva Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="identify/delete duplicate files residing within specified directories"
+HOMEPAGE="http://netdial.caribe.net/~adrian2/fdupes.html"
+SRC_URI="http://netdial.caribe.net/~adrian2/programs/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="md5sum-external"
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-memcpy.patch
+ epatch "${FILESDIR}"/${P}-external-md5sum-quotation-1.patch
+ if use md5sum-external; then
+ sed -i -e 's/^#EXTERNAL_MD5[[:blank:]]*= /EXTERNAL_MD5 = /g' \
+ Makefile || die "sed failed"
+ fi
+ sed -e 's/-o fdupes/${CFLAGS} ${LDFLAGS} -o fdupes/' -i Makefile
+}
+
+src_compile() {
+ sed -i -e "s:gcc:$(tc-getCC):" Makefile
+ emake || die
+}
+
+src_install() {
+ dobin fdupes || die
+ doman fdupes.1
+ dodoc CHANGES CONTRIBUTORS INSTALL README TODO
+}
diff --git a/app-misc/fdupes/files/fdupes-1.40-external-md5sum-quotation-1.patch b/app-misc/fdupes/files/fdupes-1.40-external-md5sum-quotation-1.patch
new file mode 100644
index 000000000000..1815f7b6d152
--- /dev/null
+++ b/app-misc/fdupes/files/fdupes-1.40-external-md5sum-quotation-1.patch
@@ -0,0 +1,72 @@
+Source: Peter Volkov <pva@gentoo.org>
+Upstream: notified (sent email to <adrian2 AT caribe DOT net>
+Reason: bugs.gentoo.org/237828 comment #1
+With USE=md5sum-external fails on filenames with spaces in their names.
+
+Updated on 2009/06/20:
+ * Fixed free due to wrong length of memory allocation bugs.gentoo.org/273597
+ * Now works with filename that have " in name...
+
+--- fdupes.c 2009-06-20 10:51:31 +0000
++++ fdupes.c 2009-06-20 13:38:39 +0000
+@@ -291,17 +291,48 @@
+ char *getcrcsignature(char *filename)
+ {
+ static char signature[256];
++ char *backslashedfilename;
+ char *command;
+ char *separator;
+ FILE *result;
+-
+- command = (char*) malloc(strlen(filename)+strlen(EXTERNAL_MD5)+2);
++ int i=0;
++ int j=0;
++ int numofquotes=0;
++
++ /* Find number of " in filename */
++ while ( filename[i] != '\0' ) {
++ if ( filename[i] == '\"' )
++ numofquotes++;
++ i++;
++ }
++
++ backslashedfilename = (char*) malloc(strlen(filename)+numofquotes+1);
++ if (backslashedfilename == NULL) {
++ errormsg("out of memory\n");
++ exit(1);
++ }
++
++ /* Put backslash before each " */
++ i=0;
++ while ( filename[i] != '\0' ) {
++ if ( filename[i] == '\"' ) {
++ backslashedfilename[j]='\\';
++ j++;
++ }
++ backslashedfilename[j]=filename[i];
++ i++;
++ j++;
++ }
++ backslashedfilename[j]='\0';
++
++ command = (char*) malloc(strlen(backslashedfilename)+strlen(EXTERNAL_MD5)+6);
+ if (command == NULL) {
+ errormsg("out of memory\n");
+ exit(1);
+ }
+
+- sprintf(command, "%s %s", EXTERNAL_MD5, filename);
++ /* Qoutation required to works spaces in filenames */
++ sprintf(command, "%s \"%s\"", EXTERNAL_MD5, backslashedfilename);
+
+ result = popen(command, "r");
+ if (result == NULL) {
+@@ -309,6 +340,7 @@
+ exit(1);
+ }
+
++ free(backslashedfilename);
+ free(command);
+
+ if (fgets(signature, 256, result) == NULL) {
+