File tree Expand file tree Collapse file tree 4 files changed +34
-28
lines changed
codeserver/ubi9-python-3.12/nginx/root/usr/share/container-scripts/nginx
c9s-python-3.11/nginx/root/usr/share/container-scripts/nginx
rhel9-python-3.11/nginx/root/usr/share/container-scripts/nginx Expand file tree Collapse file tree 4 files changed +34
-28
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/env bash
2
2
3
3
# get_matched_files finds file for image extending
4
4
function get_matched_files() {
@@ -17,15 +17,15 @@ function process_extending_files() {
17
17
local custom_dir default_dir
18
18
custom_dir=$1
19
19
default_dir=$2
20
- while read filename ; do
21
- if [ $filename ]; then
20
+ while read -r filename ; do
21
+ if [ " $filename " ]; then
22
22
echo " => sourcing $filename ..."
23
- # Custom file is prefered
24
- if [ -f $custom_dir /$filename ]; then
25
- source $custom_dir /$filename
26
- elif [ -f $default_dir /$filename ]; then
27
- source $default_dir /$filename
23
+ # custom file has precedence
24
+ if [ -f " $custom_dir /$filename " ]; then
25
+ source " $custom_dir /$filename "
26
+ elif [ -f " $default_dir /$filename " ]; then
27
+ source " $default_dir /$filename "
28
28
fi
29
29
fi
30
30
done <<< " $(get_matched_files " $custom_dir " " $default_dir " '*.sh' | sort -u)"
31
- }
31
+ }
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/env bash
2
2
3
3
# get_matched_files finds file for image extending
4
4
function get_matched_files() {
@@ -17,15 +17,15 @@ function process_extending_files() {
17
17
local custom_dir default_dir
18
18
custom_dir=$1
19
19
default_dir=$2
20
- while read filename ; do
21
- if [ $filename ]; then
20
+ while read -r filename ; do
21
+ if [ " $filename " ]; then
22
22
echo " => sourcing $filename ..."
23
- # Custom file is prefered
24
- if [ -f $custom_dir /$filename ]; then
25
- source $custom_dir /$filename
26
- elif [ -f $default_dir /$filename ]; then
27
- source $default_dir /$filename
23
+ # custom file has precedence
24
+ if [ -f " $custom_dir /$filename " ]; then
25
+ source " $custom_dir /$filename "
26
+ elif [ -f " $default_dir /$filename " ]; then
27
+ source " $default_dir /$filename "
28
28
fi
29
29
fi
30
30
done <<< " $(get_matched_files " $custom_dir " " $default_dir " '*.sh' | sort -u)"
31
- }
31
+ }
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/env bash
2
2
3
3
# get_matched_files finds file for image extending
4
4
function get_matched_files() {
@@ -17,15 +17,15 @@ function process_extending_files() {
17
17
local custom_dir default_dir
18
18
custom_dir=$1
19
19
default_dir=$2
20
- while read filename ; do
21
- if [ $filename ]; then
20
+ while read -r filename ; do
21
+ if [ " $filename " ]; then
22
22
echo " => sourcing $filename ..."
23
- # Custom file is prefered
24
- if [ -f $custom_dir /$filename ]; then
25
- source $custom_dir /$filename
26
- elif [ -f $default_dir /$filename ]; then
27
- source $default_dir /$filename
23
+ # custom file has precedence
24
+ if [ -f " $custom_dir /$filename " ]; then
25
+ source " $custom_dir /$filename "
26
+ elif [ -f " $default_dir /$filename " ]; then
27
+ source " $default_dir /$filename "
28
28
fi
29
29
fi
30
30
done <<< " $(get_matched_files " $custom_dir " " $default_dir " '*.sh' | sort -u)"
31
- }
31
+ }
Original file line number Diff line number Diff line change @@ -321,11 +321,17 @@ def test_files_that_should_be_same_are_same(subtests: pytest_subtests.plugin.Sub
321
321
"ROCm de-vendor script" : [
322
322
PROJECT_ROOT / "jupyter/rocm/pytorch/ubi9-python-3.12/de-vendor-torch.sh" ,
323
323
PROJECT_ROOT / "runtimes/rocm-pytorch/ubi9-python-3.12/de-vendor-torch.sh" ,
324
- ]
324
+ ],
325
+ "nginx/common.sh" : [
326
+ PROJECT_ROOT / "codeserver/ubi9-python-3.12/nginx/root/usr/share/container-scripts/nginx/common.sh" ,
327
+ PROJECT_ROOT / "rstudio/c9s-python-3.11/nginx/root/usr/share/container-scripts/nginx/common.sh" ,
328
+ PROJECT_ROOT / "rstudio/rhel9-python-3.11/nginx/root/usr/share/container-scripts/nginx/common.sh" ,
329
+ ],
325
330
}
326
331
for group_name , (first_file , * rest ) in file_groups .items ():
327
332
with subtests .test (msg = f"Checking { group_name } " ):
328
333
for file in rest :
334
+ # file.write_text(first_file.read_text()) # update rest according to first
329
335
assert first_file .read_text () == file .read_text (), f"The files { first_file } and { file } do not match"
330
336
331
337
You can’t perform that action at this time.
0 commit comments