Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #29345: fix one more newline-constant bashism in SAGE_SPKG_ENABLE.
Browse files Browse the repository at this point in the history
This is essentially the same fix used in SAGE_SPKG_COLLECT and in our
configure.ac file. It reorders some things to print newlines followed
by the stuff we want, rather than the other way around. This prevents
the newlines from being stripped out of the subshell's output entirely.
This macro was previously using AS_VAR_SET for this purpose, but for
clarity I have reduced it to a standard shell-variable definition. The
name of the variable itself is not dynamic, and this saves us from
needing to think about m4 whitespace quoting and escaping rules.
  • Loading branch information
orlitzky authored and dimpase committed Jun 15, 2020
1 parent 902e531 commit bbf5265
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,12 @@ STANDARD_PACKAGE_INSTS = \
$(foreach pkgname,$(STANDARD_PACKAGES),$(inst_$(pkgname)))

# All optional installed packages (triggers the auto-update)
OPTIONAL_INSTALLED_PACKAGES = \
@SAGE_OPTIONAL_INSTALLED_PACKAGES@
OPTIONAL_INSTALLED_PACKAGES = @SAGE_OPTIONAL_INSTALLED_PACKAGES@
OPTIONAL_INSTALLED_PACKAGE_INSTS = \
$(foreach pkgname,$(OPTIONAL_INSTALLED_PACKAGES),$(inst_$(pkgname)))

# All previously installed optional packages that are to be uninstalled
OPTIONAL_CLEANED_PACKAGES = \
@SAGE_OPTIONAL_CLEANED_PACKAGES@
OPTIONAL_CLEANED_PACKAGES = @SAGE_OPTIONAL_CLEANED_PACKAGES@
OPTIONAL_CLEANED_PACKAGES_CLEANS = $(OPTIONAL_CLEANED_PACKAGES:%=%-clean)

# All packages which should be downloaded
Expand Down
3 changes: 2 additions & 1 deletion m4/sage_spkg_enable.m4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ AS_HELP_STRING([--disable-]SPKG_NAME,
AS_IF([test "$want_spkg" = if_installed],
[AS_VAR_SET([want_spkg], $is_installed)])
AS_VAR_SET([spkg_line], [" ]SPKG_NAME[ \\"$'\n'])
spkg_line=" \\$(printf '\n ')SPKG_NAME"
AS_CASE([$is_installed-$want_spkg],
[*-yes], [AS_VAR_APPEND(SAGE_OPTIONAL_INSTALLED_PACKAGES, "$spkg_line")],
[yes-no], [AS_VAR_APPEND(SAGE_OPTIONAL_CLEANED_PACKAGES, "$spkg_line")])
Expand Down

0 comments on commit bbf5265

Please sign in to comment.