Skip to content

Commit 5d86c85

Browse files
edmorleytianon
authored andcommitted
Correct operator precedence in find conditionals
Previously the `type` option was only being applied to the first `-name` option, rather than both. Fixes #212.
1 parent f99bb35 commit 5d86c85

23 files changed

+92
-92
lines changed

2.7/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ RUN set -ex \
4848
\
4949
&& find /usr/local -depth \
5050
\( \
51-
\( -type d -a -name test -o -name tests \) \
51+
\( -type d -a \( -name test -o -name tests \) \) \
5252
-o \
53-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
53+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
5454
\) -exec rm -rf '{}' + \
5555
&& rm -rf /usr/src/python
5656

@@ -70,9 +70,9 @@ RUN set -ex; \
7070
\
7171
find /usr/local -depth \
7272
\( \
73-
\( -type d -a -name test -o -name tests \) \
73+
\( -type d -a \( -name test -o -name tests \) \) \
7474
-o \
75-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
75+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
7676
\) -exec rm -rf '{}' +; \
7777
rm -f get-pip.py
7878

2.7/alpine/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ RUN set -ex \
7474
\
7575
&& find /usr/local -depth \
7676
\( \
77-
\( -type d -a -name test -o -name tests \) \
77+
\( -type d -a \( -name test -o -name tests \) \) \
7878
-o \
79-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
79+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
8080
\) -exec rm -rf '{}' + \
8181
&& rm -rf /usr/src/python
8282

@@ -100,9 +100,9 @@ RUN set -ex; \
100100
\
101101
find /usr/local -depth \
102102
\( \
103-
\( -type d -a -name test -o -name tests \) \
103+
\( -type d -a \( -name test -o -name tests \) \) \
104104
-o \
105-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
105+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
106106
\) -exec rm -rf '{}' +; \
107107
rm -f get-pip.py
108108

2.7/alpine3.6/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ RUN set -ex \
7474
\
7575
&& find /usr/local -depth \
7676
\( \
77-
\( -type d -a -name test -o -name tests \) \
77+
\( -type d -a \( -name test -o -name tests \) \) \
7878
-o \
79-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
79+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
8080
\) -exec rm -rf '{}' + \
8181
&& rm -rf /usr/src/python
8282

@@ -100,9 +100,9 @@ RUN set -ex; \
100100
\
101101
find /usr/local -depth \
102102
\( \
103-
\( -type d -a -name test -o -name tests \) \
103+
\( -type d -a \( -name test -o -name tests \) \) \
104104
-o \
105-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
105+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
106106
\) -exec rm -rf '{}' +; \
107107
rm -f get-pip.py
108108

2.7/slim/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ RUN set -ex \
6363
\
6464
&& find /usr/local -depth \
6565
\( \
66-
\( -type d -a -name test -o -name tests \) \
66+
\( -type d -a \( -name test -o -name tests \) \) \
6767
-o \
68-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
68+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
6969
\) -exec rm -rf '{}' + \
7070
&& rm -rf /usr/src/python
7171

@@ -91,9 +91,9 @@ RUN set -ex; \
9191
\
9292
find /usr/local -depth \
9393
\( \
94-
\( -type d -a -name test -o -name tests \) \
94+
\( -type d -a \( -name test -o -name tests \) \) \
9595
-o \
96-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
96+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9797
\) -exec rm -rf '{}' +; \
9898
rm -f get-pip.py
9999

2.7/wheezy/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ RUN set -ex \
4848
\
4949
&& find /usr/local -depth \
5050
\( \
51-
\( -type d -a -name test -o -name tests \) \
51+
\( -type d -a \( -name test -o -name tests \) \) \
5252
-o \
53-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
53+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
5454
\) -exec rm -rf '{}' + \
5555
&& rm -rf /usr/src/python
5656

@@ -70,9 +70,9 @@ RUN set -ex; \
7070
\
7171
find /usr/local -depth \
7272
\( \
73-
\( -type d -a -name test -o -name tests \) \
73+
\( -type d -a \( -name test -o -name tests \) \) \
7474
-o \
75-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
75+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
7676
\) -exec rm -rf '{}' +; \
7777
rm -f get-pip.py
7878

3.3/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ RUN set -ex \
5757
\
5858
&& find /usr/local -depth \
5959
\( \
60-
\( -type d -a -name test -o -name tests \) \
60+
\( -type d -a \( -name test -o -name tests \) \) \
6161
-o \
62-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
62+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
6363
\) -exec rm -rf '{}' + \
6464
&& rm -rf /usr/src/python
6565

@@ -86,9 +86,9 @@ RUN set -ex; \
8686
\
8787
find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' +; \
9393
rm -f get-pip.py
9494

3.3/alpine/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ RUN set -ex \
8686
\
8787
&& find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' + \
9393
&& rm -rf /usr/src/python
9494

@@ -119,9 +119,9 @@ RUN set -ex; \
119119
\
120120
find /usr/local -depth \
121121
\( \
122-
\( -type d -a -name test -o -name tests \) \
122+
\( -type d -a \( -name test -o -name tests \) \) \
123123
-o \
124-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
124+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
125125
\) -exec rm -rf '{}' +; \
126126
rm -f get-pip.py
127127

3.3/slim/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ RUN set -ex \
7676
\
7777
&& find /usr/local -depth \
7878
\( \
79-
\( -type d -a -name test -o -name tests \) \
79+
\( -type d -a \( -name test -o -name tests \) \) \
8080
-o \
81-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
81+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
8282
\) -exec rm -rf '{}' + \
8383
&& rm -rf /usr/src/python
8484

@@ -111,9 +111,9 @@ RUN set -ex; \
111111
\
112112
find /usr/local -depth \
113113
\( \
114-
\( -type d -a -name test -o -name tests \) \
114+
\( -type d -a \( -name test -o -name tests \) \) \
115115
-o \
116-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
116+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
117117
\) -exec rm -rf '{}' +; \
118118
rm -f get-pip.py
119119

3.3/wheezy/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ RUN set -ex \
5757
\
5858
&& find /usr/local -depth \
5959
\( \
60-
\( -type d -a -name test -o -name tests \) \
60+
\( -type d -a \( -name test -o -name tests \) \) \
6161
-o \
62-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
62+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
6363
\) -exec rm -rf '{}' + \
6464
&& rm -rf /usr/src/python
6565

@@ -86,9 +86,9 @@ RUN set -ex; \
8686
\
8787
find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' +; \
9393
rm -f get-pip.py
9494

3.4/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ RUN set -ex \
5757
\
5858
&& find /usr/local -depth \
5959
\( \
60-
\( -type d -a -name test -o -name tests \) \
60+
\( -type d -a \( -name test -o -name tests \) \) \
6161
-o \
62-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
62+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
6363
\) -exec rm -rf '{}' + \
6464
&& rm -rf /usr/src/python
6565

@@ -86,9 +86,9 @@ RUN set -ex; \
8686
\
8787
find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' +; \
9393
rm -f get-pip.py
9494

3.4/alpine/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ RUN set -ex \
8686
\
8787
&& find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' + \
9393
&& rm -rf /usr/src/python
9494

@@ -119,9 +119,9 @@ RUN set -ex; \
119119
\
120120
find /usr/local -depth \
121121
\( \
122-
\( -type d -a -name test -o -name tests \) \
122+
\( -type d -a \( -name test -o -name tests \) \) \
123123
-o \
124-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
124+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
125125
\) -exec rm -rf '{}' +; \
126126
rm -f get-pip.py
127127

3.4/slim/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ RUN set -ex \
7676
\
7777
&& find /usr/local -depth \
7878
\( \
79-
\( -type d -a -name test -o -name tests \) \
79+
\( -type d -a \( -name test -o -name tests \) \) \
8080
-o \
81-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
81+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
8282
\) -exec rm -rf '{}' + \
8383
&& rm -rf /usr/src/python
8484

@@ -111,9 +111,9 @@ RUN set -ex; \
111111
\
112112
find /usr/local -depth \
113113
\( \
114-
\( -type d -a -name test -o -name tests \) \
114+
\( -type d -a \( -name test -o -name tests \) \) \
115115
-o \
116-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
116+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
117117
\) -exec rm -rf '{}' +; \
118118
rm -f get-pip.py
119119

3.4/wheezy/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ RUN set -ex \
5757
\
5858
&& find /usr/local -depth \
5959
\( \
60-
\( -type d -a -name test -o -name tests \) \
60+
\( -type d -a \( -name test -o -name tests \) \) \
6161
-o \
62-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
62+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
6363
\) -exec rm -rf '{}' + \
6464
&& rm -rf /usr/src/python
6565

@@ -86,9 +86,9 @@ RUN set -ex; \
8686
\
8787
find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' +; \
9393
rm -f get-pip.py
9494

3.5/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ RUN set -ex \
5757
\
5858
&& find /usr/local -depth \
5959
\( \
60-
\( -type d -a -name test -o -name tests \) \
60+
\( -type d -a \( -name test -o -name tests \) \) \
6161
-o \
62-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
62+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
6363
\) -exec rm -rf '{}' + \
6464
&& rm -rf /usr/src/python
6565

@@ -86,9 +86,9 @@ RUN set -ex; \
8686
\
8787
find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' +; \
9393
rm -f get-pip.py
9494

3.5/alpine/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ RUN set -ex \
8686
\
8787
&& find /usr/local -depth \
8888
\( \
89-
\( -type d -a -name test -o -name tests \) \
89+
\( -type d -a \( -name test -o -name tests \) \) \
9090
-o \
91-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
91+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
9292
\) -exec rm -rf '{}' + \
9393
&& rm -rf /usr/src/python
9494

@@ -119,9 +119,9 @@ RUN set -ex; \
119119
\
120120
find /usr/local -depth \
121121
\( \
122-
\( -type d -a -name test -o -name tests \) \
122+
\( -type d -a \( -name test -o -name tests \) \) \
123123
-o \
124-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
124+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
125125
\) -exec rm -rf '{}' +; \
126126
rm -f get-pip.py
127127

3.5/slim/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ RUN set -ex \
7676
\
7777
&& find /usr/local -depth \
7878
\( \
79-
\( -type d -a -name test -o -name tests \) \
79+
\( -type d -a \( -name test -o -name tests \) \) \
8080
-o \
81-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
81+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
8282
\) -exec rm -rf '{}' + \
8383
&& rm -rf /usr/src/python
8484

@@ -111,9 +111,9 @@ RUN set -ex; \
111111
\
112112
find /usr/local -depth \
113113
\( \
114-
\( -type d -a -name test -o -name tests \) \
114+
\( -type d -a \( -name test -o -name tests \) \) \
115115
-o \
116-
\( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
116+
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
117117
\) -exec rm -rf '{}' +; \
118118
rm -f get-pip.py
119119

0 commit comments

Comments
 (0)