Skip to content

Commit

Permalink
bpo-46023: makesetup: skip all duplicate modules (GH-32234)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran committed Apr 1, 2022
1 parent 079143d commit abdd69c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
@@ -0,0 +1,2 @@
``makesetup`` now detects and skips all duplicated module definitions. The
first entry wins.
18 changes: 12 additions & 6 deletions Modules/makesetup
Expand Up @@ -117,6 +117,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
BUILT=
BUILT_SHARED=
DISABLED=
CONFIGURED=
MODS=
SHAREDMODS=
OBJS=
Expand Down Expand Up @@ -206,12 +207,17 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
cpps="\$(MODULE_${mods_upper}_CFLAGS)"
libs="\$(MODULE_${mods_upper}_LDFLAGS)"
fi
case $DISABLED in
*$mods*)
# disabled by previous rule / Setup file
continue
;;
esac
for mod in $mods
do
case $CONFIGURED in
*,${mod},*)
# Detected multiple rules for a module, first rule wins. This
# allows users to disable modules in Setup.local.
echo 1>&2 "maksetup: '$mod' was handled by previous rule."
continue 2;;
esac
CONFIGURED="$CONFIGURED,${mod},"
done
case $doconfig in
yes)
LIBS="$LIBS $libs"
Expand Down

0 comments on commit abdd69c

Please sign in to comment.