This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] cygport, find ... -exec

Usually, the 'find ... -exec cmd ...' idiom makes a lot of sense -- it's faster, one fewer forks (maybe MANY fewer), etc.

However, you sometimes run into troubles with extremely long filelists. As I did with ncurses (1183 files in the build/ directory) -- and I got a 'too many files' error from touch resulting from this command in __prepinstalldirs:

find ${B} -type f -exec touch -t $(date +%Y%m%d%H%M.%S) '{}' +;

The attached patch reverts to using -print0 | xargs -0 instead of -exec.

Index: bin/
RCS file: /cvsroot/cygwin-ports/cygport/bin/,v
retrieving revision 1.29
diff -u -r1.29
--- bin/	30 Oct 2006 06:09:47 -0000	1.29
+++ bin/	15 Nov 2006 07:28:09 -0000
@@ -873,7 +873,7 @@
 	# circumvent pointless libtool relinking during install
 	find ${B} -name '*.la' -exec sed -i -e 's!^relink_command=.*!!' '{}' +;
-	find ${B} -type f -exec touch -t $(date +%Y%m%d%H%M.%S) '{}' +;
+	find ${B} -type f -print0 | xargs -0 touch -t $(date +%Y%m%d%H%M.%S)
 # run 'make install'

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]