httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: PR2084 and 'make install'
Date Tue, 21 Apr 1998 06:43:47 GMT

In article <199804210218.WAA18313@devsys.jaguNET.com> you wrote:
> PR2084 reports that 'make install' will overwrite index.html
> (and others)... I agree that this might not make sense...

> Comments on the below?:

Yeah, good suggestion. But I would like to see the patch a little bit
different. Because the user should be notified what we are
preserving/skipping. This way the user either sees

| :> make install-docroot
| ===> [docroot: Installing initial DocumentRoot files]
| Copying tree ./htdocs/ -> /tmp/apache/share/htdocs/
| Copying tree ./icons/ -> /tmp/apache/share/icons/
| Copying tree ./cgi-bin/ -> /tmp/apache/share/cgi-bin/
| <=== [docroot]

or

| :> make install-docroot
| ===> [docroot: Installing initial DocumentRoot files]
| [PRESERVING EXISTING DocumentRoot: /tmp/apache/share/htdocs/]
| Copying tree ./icons/ -> /tmp/apache/share/icons/
| Copying tree ./cgi-bin/ -> /tmp/apache/share/cgi-bin/
| <=== [docroot]

The difference to your patch is:

1. We only skip htdocs, because icons and cgi-bin
   can be updated safely.

2. The user sees in which Make target the preserving occurs

3. The user sees a similar message to the one occuring
   when we preserve the *.conf files.

Alternative patch appended.
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Index: Makefile.tmpl
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/Makefile.tmpl,v
retrieving revision 1.20
diff -u -r1.20 Makefile.tmpl
--- Makefile.tmpl	1998/04/20 06:40:00	1.20
+++ Makefile.tmpl	1998/04/21 06:38:44
@@ -310,18 +310,22 @@
 #   icons and distributed CGI scripts.
 install-docroot:
 	@echo "===> [docroot: Installing initial DocumentRoot files]"
-	-(cd $(ROOT)/htdocs/ && $(TAR) cf - *) |\
-	 (cd $(datadir)/htdocs/ && $(TAR) xf -)
-	-find $(datadir)/htdocs/ -type d -exec chmod a+rx {} \;
-	-find $(datadir)/htdocs/ -type f -exec chmod a+r {} \;
-	-(cd $(ROOT)/icons/ && $(TAR) cf - *) |\
-	 (cd $(datadir)/icons/ && $(TAR) xf -)
-	-find $(datadir)/icons/ -type d -exec chmod a+rx {} \;
-	-find $(datadir)/icons/ -type f -exec chmod a+r {} \;
-	-(cd $(ROOT)/cgi-bin/ && $(TAR) cf - *) |\
-	 (cd $(datadir)/cgi-bin/ && $(TAR) xf -)
-	-find $(datadir)/cgi-bin/ -type d -exec chmod a+rx {} \;
-	-find $(datadir)/cgi-bin/ -type f -exec chmod a+r {} \;
+	-@if [ -f $(datadir)/htdocs/index.html ]; then \
+		echo "[PRESERVING EXISTING DocumentRoot: $(datadir)/htdocs/]"; \
+	else \
+		echo "Copying tree $(ROOT)/htdocs/ -> $(datadir)/htdocs/"; \
+		(cd $(ROOT)/htdocs/ && $(TAR) cf - *) |\
+		(cd $(datadir)/htdocs/ && $(TAR) xf -); \
+		find $(datadir)/htdocs/ -type d -exec chmod a+rx {} \; ; \
+		find $(datadir)/htdocs/ -type f -exec chmod a+r {} \; ; \
+	fi
+	@for subdir in icons cgi-bin; do \
+		echo "Copying tree $(ROOT)/$$subdir/ -> $(datadir)/$$subdir/"; \
+		(cd $(ROOT)/$$subdir/ && $(TAR) cf - *) |\
+		(cd $(datadir)/$$subdir/ && $(TAR) xf -); \
+		find $(datadir)/$$subdir/ -type d -exec chmod a+rx {} \; ; \
+		find $(datadir)/$$subdir/ -type f -exec chmod a+r {} \; ; \
+	done
 	@echo "<=== [docroot]"
 
 #   create the initial configuration by providing default files

Mime
View raw message