[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.49-105-gac1319a

Andreas Beckmann anbe at debian.org
Fri Mar 1 15:32:57 UTC 2013


The following commit has been merged in the piatti branch:
commit 772953ec0885725af5b3bd96f96e9535cc2bf618
Author: Andreas Beckmann <anbe at debian.org>
Date:   Wed Feb 20 19:22:25 2013 +0100

    Makefile: add support for placeholders in scripts
    
    e.g. @sharedir@ to find read_config.sh
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/Makefile b/Makefile
index e012d7f..57704a6 100644
--- a/Makefile
+++ b/Makefile
@@ -59,10 +59,18 @@ install-conf-4-running-from-git:
 	install -d $(DESTDIR)$(sharedir)/piuparts/slave
 	install -m 0755 update-piuparts-setup $(DESTDIR)$(sharedir)/piuparts/slave/
 
+SCRIPTS_TEMPLATES	 = $(wildcard master-bin/*.in slave-bin/*.in)
+SCRIPTS_GENERATED	 = $(SCRIPTS_TEMPLATES:.in=)
+
+%: %.in
+	sed -r \
+		-e "s%@sharedir@%$(sharedir)%g" \
+		$< > $@
+
 python-syntax-check:
 	@set -e -x; $(foreach py,$(wildcard *.py piupartslib/*.py),python -m py_compile $(py);)
 
-build: python-syntax-check
+build: python-syntax-check $(SCRIPTS_GENERATED)
 	@set -e -x ; \
 		for file in piuparts piuparts-slave piuparts-master piuparts-report piuparts-analyze; do \
 		sed -e 's/__PIUPARTS_VERSION__/$(version)/g' $$file.py > $$file ; done
@@ -83,13 +91,13 @@ install:
 	install -m 0644 lib/*.sh $(DESTDIR)$(sharedir)/piuparts/lib/
 
 	install -d $(DESTDIR)$(sharedir)/piuparts/master
-	install -m 0755 master-bin/* $(DESTDIR)$(sharedir)/piuparts/master
+	install -m 0755 $(filter-out %.in,$(wildcard master-bin/*)) $(DESTDIR)$(sharedir)/piuparts/master/
 
 	install -d $(DESTDIR)$(sharedir)/piuparts/master/known_problems
 	install -m 0644 known_problems/*.conf $(DESTDIR)$(sharedir)/piuparts/master/known_problems/
 
 	install -d $(DESTDIR)$(sharedir)/piuparts/slave
-	install -m 0755 slave-bin/* $(DESTDIR)$(sharedir)/piuparts/slave
+	install -m 0755 $(filter-out %.in,$(wildcard slave-bin/*)) $(DESTDIR)$(sharedir)/piuparts/slave/
 
 	install -d $(DESTDIR)$(htdocsdir)
 	install -m 0644 htdocs/*.* $(DESTDIR)$(htdocsdir)/
@@ -120,3 +128,4 @@ clean:
 	rm -f piuparts piuparts-slave piuparts-master piuparts-report piuparts-analyze
 	rm -f piuparts.1 piuparts.1.xml piuparts.1.html README.xml README.html docbook-xsl.css piuparts.html
 	rm -f *.pyc piupartslib/*.pyc
+	rm -f $(SCRIPTS_GENERATED)
diff --git a/debian/changelog b/debian/changelog
index 0eddf05..339ec76 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,7 @@ piuparts (0.50) UNRELEASED; urgency=low
   * Makefile:
     - Add DESTDIR support.
     - Perform syntax check on *.py before installation.
+    - Add support for applying substitutions in master/slave scripts.
   * debian/rules: Set 'prefix' and 'DESTDIR' for build and install.
   * lib/read_config.sh: Factored out the piuparts.conf reading function that
     is used by all master/slave shell scripts. Shipped in piuparts.common.

-- 
piuparts git repository



More information about the Piuparts-commits mailing list