]> mj.ucw.cz Git - libucw.git/commitdiff
Support for 'make CONFIRM=y install'
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Thu, 31 Jan 2008 20:48:40 +0000 (21:48 +0100)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Thu, 31 Jan 2008 20:48:40 +0000 (21:48 +0100)
build/Makebottom
build/Maketop
build/installer

index a474614bb2817c9f93e6310c22b347d443a83269..b6f716eab6d5ad98ad380c2d4735a2c6ac3b4924 100644 (file)
@@ -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
index 1ac82d98336633282cf30f87c336ad0a9987b755..4496f9f2dcf019fcf9a5d16de9509680c083307e 100644 (file)
@@ -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
 
index b5bf16f20f9b699d18733b52193cbc4b7097e6a2..39e62e61be2d068d632482b9fb765f8eccf2ced1 100755 (executable)
@@ -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