From e66085236c893a98ce9db7e020a6d049a3e8b0a9 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Thu, 31 Jan 2008 21:48:40 +0100 Subject: [PATCH] Support for 'make CONFIRM=y install' --- build/Makebottom | 2 +- build/Maketop | 3 +++ build/installer | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build/Makebottom b/build/Makebottom index a474614b..b6f716ea 100644 --- a/build/Makebottom +++ b/build/Makebottom @@ -185,7 +185,7 @@ $(DATAFILES): $(o)/%: $(s)/% # Default installation target default-install: - SH_EXTRA_RUNDIRS="$(sort $(EXTRA_RUNDIRS))" SH_INSTALL_RUNDIRS="$(sort $(INSTALL_RUNDIRS))" SH_CONFIGS="$(sort $(CONFIGS))" $(s)/build/installer $(INSTALL_DIR) + SH_EXTRA_RUNDIRS="$(sort $(EXTRA_RUNDIRS))" SH_INSTALL_RUNDIRS="$(sort $(INSTALL_RUNDIRS))" SH_CONFIGS="$(sort $(CONFIGS))" SH_AUTO_CONFIRM="$(CONFIRM)" $(s)/build/installer $(INSTALL_DIR) # Don't delete intermediate targets. There shouldn't be any, but due to bugs # in GNU Make rules with targets in not-yet-existing directories are ignored diff --git a/build/Maketop b/build/Maketop index 1ac82d98..4496f9f2 100644 --- a/build/Maketop +++ b/build/Maketop @@ -4,6 +4,9 @@ # Set to 1 if you want verbose output V=0 +# Set to 'y' (or 'n') if you want to auto-confirm (auto-reject) all questions +CONFIRM= + # Disable all built-in rules and variables. Speeds up make and simplifies debugging. MAKEFLAGS+=-rR diff --git a/build/installer b/build/installer index b5bf16f2..39e62e61 100755 --- a/build/installer +++ b/build/installer @@ -26,7 +26,12 @@ for a in $SH_CONFIGS ; do echo "cf/$a: no differences" else echo -n "cf/$a differs, replace it [Yn]? " - read x + if [ -z "$SH_AUTO_CONFIRM" ] ; then + read x + else + x="$SH_AUTO_CONFIRM" + echo "$x" + fi if [ -z "$x" -o "$x" = "y" -o "$x" = "Y" ] ; then echo "cf/$a: replacing and keeping the old version as cf/$a.old" mv $DEST/cf/$a $DEST/cf/$a.old -- 2.39.2