Skip to content

Commit

Permalink
for upstream config check, use filecmp instead of system diff
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA committed Jul 27, 2024
1 parent 0fd34ca commit ab342b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spack-ext/lib/jcsda-emc/spack-stack/stack/stack_env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import filecmp
import io
import logging
import os
Expand Down Expand Up @@ -280,7 +281,8 @@ def write(self):
"site": os.path.normpath(os.path.join(upstream_path, "../site/")),
}
for n in ("common", "site"):
if os.system("diff -rq %s %s &> /dev/null" % (env_config_dirs[n], upstream_config_dirs[n])):
comparison = filecmp.dircmp(upstream_config_dirs[n], env_config_dirs[n])
if comparison.diff_files or comparison.left_only or comparison.right_only:
logging.warning(
(f"WARNING: {n} config directories for this environment and upstream "
f"'{upstream_path}' do not match! Verify that you are using the same "
Expand Down

0 comments on commit ab342b1

Please sign in to comment.