r864 - trunk/scripts

lizardo at linuxfromscratch.org lizardo at linuxfromscratch.org
Sat Oct 30 14:35:09 PDT 2004


Author: lizardo
Date: 2004-10-30 15:35:08 -0600 (Sat, 30 Oct 2004)
New Revision: 864

Modified:
   trunk/scripts/update-website.mk
Log:
Added rules to update-website.mk to update project-specific sections individually.



Modified: trunk/scripts/update-website.mk
===================================================================
--- trunk/scripts/update-website.mk	2004-10-30 14:54:49 UTC (rev 863)
+++ trunk/scripts/update-website.mk	2004-10-30 21:35:08 UTC (rev 864)
@@ -9,6 +9,7 @@
 # script) run
 #
 #	cd "<target_dir>" &&
+#	umask 002 &&
 #	./scripts/update-website.mk svn-update &&
 #	./scripts/update-website.mk update-website
 #
@@ -38,11 +39,7 @@
 # Current year
 YEAR = $(shell date +%Y)
 
-update-website: backup news-archive svnlog website.html news-html news-rss \
-	mirrors-list update-patches update-hints error-pages set-perms run-rsync
-# Add the timestamp for mirrors
-	mkdir -p timestamp
-	date +%s > timestamp/timestamp
+update-website: update-alfs update-blfs update-hints update-lfs update-patches update-www
 
 news-archive: $(foreach y,$(YEARS),$(foreach i,$(PROJECTS),news/$(i)/$(y)))
 
@@ -50,8 +47,8 @@
 
 news-rss: alfs/feed.rss blfs/feed.rss lfs/feed.rss
 
-backup: $(TARGETDIR)
-#	tar -cPf /var/tmp/website-backup.tar $(TARGETDIR)
+backup:
+	tar -cPf /var/tmp/website-backup.tar $(TARGETDIR)
 
 # Useful for the initial repository setup
 svn-checkout:
@@ -82,36 +79,28 @@
 endef
 $(foreach y,$(YEARS),$(foreach i,$(PROJECTS),$(eval $(call gen_news_targets,$(i),$(y)))))
 
-# Assemble news pages
+svnlog-%:
+	mkdir -p logs
+	$(SVNLOG) $(SVN)/$@ 2>/dev/null | $(SVN2HTML) --with-branchname > logs/$@.tmp
+	cmp -s logs/$@.html.tmp logs/$@.html || cp logs/$@.html.tmp logs/$@.html
+	rm logs/$@.html.tmp
 
-svnlog:
+svnlog2-%:
 	mkdir -p logs
-	for repos in www patches LFS BLFS hints; do \
-	$(SVNLOG) $(SVN)/$$repos 2>/dev/null | $(SVN2HTML) --with-branchname > logs/$$repos.html.tmp; \
-	cmp -s logs/$$repos.html.tmp logs/$$repos.html || cp logs/$$repos.html.tmp logs/$$repos.html; \
-	rm logs/$$repos.html.tmp; \
-	done
+	$(SVN2HTML2) --project $@ --with-branchname > logs/$@.tmp
+	cmp -s logs/$@.html.tmp logs/$@.html || cp logs/$@.html.tmp logs/$@.html
+	rm logs/$@.html.tmp
 
 logs/%.html:
 	touch $@
 
-website.html: $(TEMPLATES)/website-*.html logs/www.html
-	cat $(TEMPLATES)/website-top.html \
-	logs/www.html \
-	$(TEMPLATES)/website-bottom.html > website.html
+alfs/news.html: $(TEMPLATES)/alfs/news-*.html news-$(YEAR).txt alfs/news-$(YEAR).txt logs/ALFS.html
+	cat $(TEMPLATES)/alfs/news-top.html > alfs/news.html
+	$(MANAGE_NEWS) -i alfs/news-$(YEAR).txt >> alfs/news.html
+	$(MANAGE_NEWS) -i news-$(YEAR).txt >> alfs/news.html
+	cat logs/ALFS.html \
+	cat $(TEMPLATES)/alfs/news-bottom.html >> alfs/news.html
 
-patches/news.html: $(TEMPLATES)/patches/news-*.html logs/patches.html
-	cat $(TEMPLATES)/patches/news-top.html \
-	logs/patches.html \
-	$(TEMPLATES)/patches/news-bottom.html > patches/news.html
-
-lfs/news.html: $(TEMPLATES)/lfs/news-*.html news-$(YEAR).txt lfs/news-$(YEAR).txt logs/LFS.html
-	cat $(TEMPLATES)/lfs/news-top.html > lfs/news.html
-	$(MANAGE_NEWS) -i lfs/news-$(YEAR).txt >> lfs/news.html
-	$(MANAGE_NEWS) -i news-$(YEAR).txt >> lfs/news.html
-	cat logs/LFS.html \
-	$(TEMPLATES)/lfs/news-bottom.html >> lfs/news.html
-
 blfs/news.html: $(TEMPLATES)/blfs/news-*.html news-$(YEAR).txt blfs/news-$(YEAR).txt logs/BLFS.html
 	cat $(TEMPLATES)/blfs/news-top.html > blfs/news.html
 	$(MANAGE_NEWS) -i blfs/news-$(YEAR).txt >> blfs/news.html
@@ -124,13 +113,23 @@
 	logs/hints.html \
 	$(TEMPLATES)/hints/news-bottom.html > hints/news.html
 
-alfs/news.html: $(TEMPLATES)/alfs/news-*.html news-$(YEAR).txt alfs/news-$(YEAR).txt
-	cat $(TEMPLATES)/alfs/news-top.html > alfs/news.html
-	$(MANAGE_NEWS) -i alfs/news-$(YEAR).txt >> alfs/news.html
-	$(MANAGE_NEWS) -i news-$(YEAR).txt >> alfs/news.html
-	$(SVN2HTML2) --project ALFS --with-branchname >> alfs/news.html
-	cat $(TEMPLATES)/alfs/news-bottom.html >> alfs/news.html
+lfs/news.html: $(TEMPLATES)/lfs/news-*.html news-$(YEAR).txt lfs/news-$(YEAR).txt logs/LFS.html
+	cat $(TEMPLATES)/lfs/news-top.html > lfs/news.html
+	$(MANAGE_NEWS) -i lfs/news-$(YEAR).txt >> lfs/news.html
+	$(MANAGE_NEWS) -i news-$(YEAR).txt >> lfs/news.html
+	cat logs/LFS.html \
+	$(TEMPLATES)/lfs/news-bottom.html >> lfs/news.html
 
+patches/news.html: $(TEMPLATES)/patches/news-*.html logs/patches.html
+	cat $(TEMPLATES)/patches/news-top.html \
+	logs/patches.html \
+	$(TEMPLATES)/patches/news-bottom.html > patches/news.html
+
+website.html: $(TEMPLATES)/website-*.html logs/www.html
+	cat $(TEMPLATES)/website-top.html \
+	logs/www.html \
+	$(TEMPLATES)/website-bottom.html > website.html
+
 # Generate RSS feeds
 %/feed.rss: %/news.html
 	$(SCRIPTS)/lfs2rss.pl -n $< -r $@
@@ -150,16 +149,28 @@
     sed "s@/lfs/news.html@/$$i/news.html at g" mirrorlist.html >> $$i/index.html; \
     cat $(TEMPLATES)/$$i/index-bottom.html >> $$i/index.html; done
 
-# Add all other content
+###########################################
+# Update project-specific website sections
+#
+# TODO: These rules should be run by each project's post-commit script or by
+# cron jobs
 
-# Fetch latest versions from patches
-# TODO This should be moved to the patches repo post-commit hook
-update-patches:
+update-alfs: svnlog2-ALFS alfs/news.html
+
+update-blfs: svnlog-BLFS blfs/news.html
+
+update-hints: svnlog-hints hints/news.html fetch-hints hints-tarball hints-symlinks hints-list
+
+update-lfs: svnlog-LFS lfs/news.html
+
+update-patches: svnlog-patches patches/news.html
 	svn -q update patches/downloads
 
-# Fetch current hints and create the hints tarball
-# TODO This should be moved to the hints repo post-commit hook
-update-hints: fetch-hints hints-tarball hints-symlinks hints-list
+update-www: svnlog-www website.html news-archive news-html news-rss \
+	mirrors-list error-pages
+# Add the timestamp for mirrors
+	mkdir -p timestamp
+	date +%s > timestamp/timestamp
 
 fetch-hints:
 	find hints/downloads -type l -exec rm '{}' \;
@@ -190,8 +201,8 @@
 #	cp {403,404}.html /home/httpd/error
 
 # Set proper permissions
-set-perms:
-	chmod -Rf g+w .
+#set-perms:
+#	chmod -Rf g+w .
 
 run-rsync:
 	for m in $(MIRRORS); do \




More information about the website mailing list