]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blobdiff - clean-source.sh
Merge branch 'dev-1.8': up to 1.8.31.6
[packages/apache-mod_pagespeed.git] / clean-source.sh
diff --git a/clean-source.sh b/clean-source.sh
new file mode 100755 (executable)
index 0000000..4bb9bdf
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+set -xe
+
+# There are directories we want to strip, but that are unnecessarily required by the build-system
+# So we drop everything but the gyp/gypi files
+almost_strip_dirs() {
+       for dir in "$@"; do
+               find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
+       done
+}
+
+export LC_ALL=C
+
+# clean sources, but preserve .gyp, .gypi
+almost_strip_dirs \
+       third_party/apr/ \
+       third_party/httpd/ \
+       third_party/httpd24/ \
+       third_party/instaweb/ \
+       third_party/openssl/ \
+       third_party/chromium/src/base/third_party/superfasthash/ \
+       third_party/chromium/src/base/third_party/symbolize/ \
+       third_party/chromium/src/base/third_party/xdg_mime/ \
+       third_party/chromium/src/base/third_party/xdg_user_dirs/ \
+
+# some more unneeded files for build
+rm -r net/instaweb/rewriter/testdata
+rm -r third_party/aprutil/gen
+rm -r third_party/chromium/src/base/test
+rm -r third_party/chromium/src/chrome
+rm -r third_party/chromium/src/net
+rm -r third_party/gflags/src/windows
+rm -r third_party/giflib/windows
+rm -r third_party/google-sparsehash/src/windows
+rm -r third_party/libjpeg_turbo/src/{mac,win}
+rm -r third_party/protobuf/java
+rm -r third_party/protobuf/src/google/protobuf/testdata
+rm -r third_party/zlib/{contrib,examples,old,doc}
+rm -r third_party/zlib/{win32,msdos,nintendods,watcom,qnx,amiga}
+
+find -type d -name testdata | xargs rm -r
+find -type d -name mac | xargs rm -r
+find -type d -name win | xargs rm -r
+find -type d -name test | xargs rm -r
+find third_party -type d -name android | xargs rm -r
+
+find -type f -name '*_test.cc' | xargs rm
+find -type f -name '*_unittest.cc' | xargs rm
+
+# not using gn nor ninja
+find -name BUILD.gn | xargs rm
+
+# cleanup empty dirs
+find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty
+
+# build/linux and third_party/chromium/src/build/linux are same dirs,
+# the later is not used by build system, but used by tarball packaging
+#rm -r third_party/chromium/src/build/linux
+#third_party/chromium/src/build/linux
This page took 0.069886 seconds and 4 git commands to generate.