]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - clean-source.sh
up to 1.9.32.4 stable
[packages/apache-mod_pagespeed.git] / clean-source.sh
CommitLineData
81c4dc24
ER
1#!/bin/sh
2set -xe
3
4# There are directories we want to strip, but that are unnecessarily required by the build-system
5# So we drop everything but the gyp/gypi files
6almost_strip_dirs() {
7 for dir in "$@"; do
8 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
9 done
10}
11
12export LC_ALL=C
13
14# clean sources, but preserve .gyp, .gypi
15almost_strip_dirs \
16 third_party/apr/ \
17 third_party/httpd/ \
18 third_party/httpd24/ \
19 third_party/instaweb/ \
20 third_party/openssl/ \
d1259ece
ER
21 third_party/chromium/src/base/third_party/superfasthash/ \
22 third_party/chromium/src/base/third_party/symbolize/ \
23 third_party/chromium/src/base/third_party/xdg_mime/ \
24 third_party/chromium/src/base/third_party/xdg_user_dirs/ \
81c4dc24
ER
25
26# some more unneeded files for build
81c4dc24 27rm -r net/instaweb/rewriter/testdata
d1259ece
ER
28rm -r third_party/aprutil/gen
29rm -r third_party/chromium/src/base/test
36c8c93e 30#rm -r third_party/chromium/src/chrome
d1259ece
ER
31rm -r third_party/chromium/src/net
32rm -r third_party/gflags/src/windows
33rm -r third_party/giflib/windows
34rm -r third_party/google-sparsehash/src/windows
35rm -r third_party/libjpeg_turbo/src/{mac,win}
36rm -r third_party/protobuf/java
37rm -r third_party/protobuf/src/google/protobuf/testdata
38rm -r third_party/zlib/{contrib,examples,old,doc}
39rm -r third_party/zlib/{win32,msdos,nintendods,watcom,qnx,amiga}
40
41find -type d -name testdata | xargs rm -r
42find -type d -name mac | xargs rm -r
43find -type d -name win | xargs rm -r
44find -type d -name test | xargs rm -r
45find third_party -type d -name android | xargs rm -r
46
47find -type f -name '*_test.cc' | xargs rm
48find -type f -name '*_unittest.cc' | xargs rm
49
50# not using gn nor ninja
51find -name BUILD.gn | xargs rm
52
53# cleanup empty dirs
54find -type d '!' -name '.' -print0 | sort -zr | xargs -0 rmdir --ignore-fail-on-non-empty
81c4dc24 55
d1259ece
ER
56# build/linux and third_party/chromium/src/build/linux are same dirs,
57# the later is not used by build system, but used by tarball packaging
81c4dc24
ER
58#rm -r third_party/chromium/src/build/linux
59#third_party/chromium/src/build/linux
This page took 0.069575 seconds and 4 git commands to generate.