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
22
33# get_matched_files finds file for image extending
44function get_matched_files() {
@@ -17,15 +17,15 @@ function process_extending_files() {
1717 local custom_dir default_dir
1818 custom_dir=$1
1919 default_dir=$2
20- while read filename ; do
21- if [ $filename ]; then
20+ while read -r filename ; do
21+ if [ " $filename " ]; then
2222 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 "
2828 fi
2929 fi
3030 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
22
33# get_matched_files finds file for image extending
44function get_matched_files() {
@@ -17,15 +17,15 @@ function process_extending_files() {
1717 local custom_dir default_dir
1818 custom_dir=$1
1919 default_dir=$2
20- while read filename ; do
21- if [ $filename ]; then
20+ while read -r filename ; do
21+ if [ " $filename " ]; then
2222 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 "
2828 fi
2929 fi
3030 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
22
33# get_matched_files finds file for image extending
44function get_matched_files() {
@@ -17,15 +17,15 @@ function process_extending_files() {
1717 local custom_dir default_dir
1818 custom_dir=$1
1919 default_dir=$2
20- while read filename ; do
21- if [ $filename ]; then
20+ while read -r filename ; do
21+ if [ " $filename " ]; then
2222 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 "
2828 fi
2929 fi
3030 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
321321 "ROCm de-vendor script" : [
322322 PROJECT_ROOT / "jupyter/rocm/pytorch/ubi9-python-3.12/de-vendor-torch.sh" ,
323323 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+ ],
325330 }
326331 for group_name , (first_file , * rest ) in file_groups .items ():
327332 with subtests .test (msg = f"Checking { group_name } " ):
328333 for file in rest :
334+ # file.write_text(first_file.read_text()) # update rest according to first
329335 assert first_file .read_text () == file .read_text (), f"The files { first_file } and { file } do not match"
330336
331337
You can’t perform that action at this time.
0 commit comments