Skip to content

Commit 02681c3

Browse files
committed
[sonic-frr] Improve the command to generate dependent files for frr submodule in frr.dep
Issue Description In frr.dep, it lists the dependent files for the submodules through 'git ls-files' and filter the symbolic links through 'grep' with explicitly patterns. The patterns might need to be adjusted upon each frr version upgrade. Enhancement The dependent files can be found by using 'find' to list all of the 'file' under the 'frr' submodule directory and pass the file to 'git ls-files' to know whether the file is included in the git control. Signed-off-by: Charlie Chen <[email protected]>
1 parent 9ecd27d commit 02681c3

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

rules/frr.dep

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11

22
SPATH := $($(FRR)_SRC_PATH)
3-
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/frr.mk rules/frr.dep
3+
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/frr.mk rules/frr.dep
44
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
55
DEP_FILES += $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files |grep -Ev '^frr$$$$'))
66

77
# Account for source files under the frr submodule directory as well.
8-
# Remove all the symbolic link files
8+
# The directories under frr submodule directory need to be filtered out because
9+
# the checksum cannot be generated against directories
910
FRR_SPATH := $(SPATH)/frr
10-
SMDEP_FILES := $(addprefix $(FRR_SPATH)/,$(shell cd $(FRR_SPATH) && git ls-files \
11-
| grep -Ev -e 'debian/changelog$$$$' \
12-
-e '^tests/topotests/bgp_instance_del_test/ce[0-9]$$$$' \
13-
-e '^tests/topotests/bgp_instance_del_test/r[0-9]$$$$' \
14-
-e '^tests/topotests/bgp_instance_del_test/scripts$$$$' \
15-
-e '^tests/topotests/bgp_instance_del_test/customize.py$$$$' \
16-
-e '^tests/topotests/bgp_rfapi_basic_sanity_config2/customize.py$$$$' \
17-
-e '^tests/topotests/bgp_rfapi_basic_sanity_config2/scripts$$$$' \
18-
-e '^tests/topotests/bgp_rfapi_basic_sanity_config2/test_bgp_rfapi_basic_sanity_config2.py$$$$' \
11+
# Use find to search the type 'file' with git ls-files under FRR_SPATH
12+
# to enumerate those managed by git
13+
SMDEP_FILES := $(addprefix $(FRR_SPATH)/,$(shell cd $(FRR_SPATH) && \
14+
find . -type f -exec git ls-files '''{}''' ';' \
15+
))
16+
# Use find to search the type 'symbolic to file' with git ls-files under FRR_SPATH
17+
# to enumerate those managed by git
18+
SMDEP_FILES += $(addprefix $(FRR_SPATH)/,$(shell cd $(FRR_SPATH) && \
19+
find . -xtype f -exec test -h '''{}''' ';' -exec git ls-files '''{}''' ';' \
1920
))
2021

21-
$(FRR)_CACHE_MODE := GIT_CONTENT_SHA
22+
$(FRR)_CACHE_MODE := GIT_CONTENT_SHA
2223
$(FRR)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
2324
$(FRR)_DEP_FILES := $(DEP_FILES)
2425
$(FRR)_SMDEP_FILES := $(SMDEP_FILES)

0 commit comments

Comments
 (0)