Browse Source

Minor fix for bad output when an empty directory is encountered or no files of the specified type are found

David Wimsey 11 years ago
parent
commit
1acbd77862
2 changed files with 8 additions and 8 deletions
  1. 6 6
      Build/cmake/gen_filelists.sh
  2. 2 2
      Build/cmake/gen_samplelists.sh

+ 6 - 6
Build/cmake/gen_filelists.sh

@@ -13,32 +13,32 @@ pypath=Python
 printfiles() {
     # Print headers
     echo ${hdr/lib/$1} >>$file
-    find  $srcpath/$1 -maxdepth 1 -iname "*.h" -exec echo '    '$srcdir/{} \; | sort >>$file
+    find  $srcpath/$1 -maxdepth 1 -iname "*.h" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file
     echo -e ')\n' >>$file
     # Print public headers
     echo ${pubhdr/lib/$1} >>$file
-    find  $hdrpath/$1 -maxdepth 1 -iname "*.h" -exec echo '    '$srcdir/{} \; | sort >>$file
+    find  $hdrpath/$1 -maxdepth 1 -iname "*.h" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file
     # Print main public header
     echo '    '$srcdir/Include/Rocket/$1.h >>$file
     echo -e ')\n' >>$file
     # Print source files
     echo ${src/lib/$1} >>$file
-    find  $srcpath/$1 -maxdepth 1 -iname "*.cpp" -exec echo '    '$srcdir/{} \; | sort >>$file
+    find  $srcpath/$1 -maxdepth 1 -iname "*.cpp" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file
     echo -e ')\n' >>$file
 }
 
 printpyfiles() {
     # Print headers
     echo ${hdr/lib/Py${1}} >>$file
-    find  $srcpath/$1/$pypath -iname "*.h" -exec echo '    '$srcdir/{} \; | sort >>$file
+    find  $srcpath/$1/$pypath -iname "*.h" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file
     echo -e ')\n' >>$file
     # Print public headers
     echo ${pubhdr/lib/Py${1}} >>$file
-    find  $hdrpath/$1/$pypath -iname "*.h" -exec echo '    '$srcdir/{} \; | sort >>$file 2>/dev/null
+    find  $hdrpath/$1/$pypath -iname "*.h" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file 2>/dev/null
     echo -e ')\n' >>$file
     # Print source files
     echo ${src/lib/Py${1}} >>$file
-    find  $srcpath/$1/$pypath -iname "*.cpp" -exec echo '    '$srcdir/{} \; | sort >>$file
+    find  $srcpath/$1/$pypath -iname "*.cpp" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file
     echo -e ')\n' >>$file
 }
 

+ 2 - 2
Build/cmake/gen_samplelists.sh

@@ -16,12 +16,12 @@ printfiles() {
     name=${1//basic\//} #substitute basic/ for nothing
     name=${name//tutorial\/} #substitute tutorial/ for nothing
     echo ${hdr/sample/$name} >>$file
-    find  $srcpath/$1/src -maxdepth 1 -iname "*.h" -exec echo '    '$srcdir/{} \; | sort -f >>$file
+    find  $srcpath/$1/src -maxdepth 1 -iname "*.h" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file
     find  $srcpath/$1/include -maxdepth 1 -iname "*.h" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file 2>/dev/null
     echo -e ')\n' >>$file
     # Print source files
     echo ${src/sample/$name} >>$file
-    find  $srcpath/$1/src -maxdepth 1 -iname "*.cpp" -exec echo '    '$srcdir/{} \; | sort -f >>$file
+    find  $srcpath/$1/src -maxdepth 1 -iname "*.cpp" -exec echo '    '$srcdir/{} \; 2>/dev/null | sort -f >>$file
     echo -e ')\n' >>$file
 }