File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -656,12 +656,20 @@ run_automodman () #"$module" "$mm" "$wc_dir" "$wc_desc"
656
656
# first f tends to be empty because of our stripping the path down so test for it -n is default operator
657
657
if [ " $pathname " ]; then
658
658
659
- # find a previous match for the path. if there is one the exitcode will be 1, otherwise 0.
660
- prevmatch=$( ! printf -- ' %s\n' " ${ARRAY[@]} " | grep -qv " ${pathname/ $incPath / } " ; echo $? )
661
-
659
+ prevmatch=0
660
+
661
+ if [[ ${incpaths[@]} ]]; then
662
+ for i in " ${incpaths[@]} "
663
+ do
664
+ if [[ " $pathname " =~ " $i " ]] ; then
665
+ prevmatch=1
666
+ fi
667
+ done
668
+ fi
669
+
662
670
# if substring then do recurse
663
- if [[ $prevmatch -eq 0 ]]; then # make sure we have not previously matched
664
-
671
+ if [[ $prevmatch -eq 0 ]]; then # make sure we have not previously matched to prevent subpaths
672
+
665
673
# pre-existing path: yes | no?
666
674
if grep -rq " ^[^#].*\s$pathname $" " ${amm} /" * " /modman" # target is what is important so find end line not beginning line
667
675
then # pre-existing path: yes
You can’t perform that action at this time.
0 commit comments