[Fusionforge-commits] r15984 - branches/Branch_5_1/src/debian

Thorsten Glaser mirabilos at fusionforge.org
Thu Jul 12 13:25:41 CEST 2012


Author: mirabilos
Date: 2012-07-12 13:25:41 +0200 (Thu, 12 Jul 2012)
New Revision: 15984

Modified:
   branches/Branch_5_1/src/debian/rules
Log:
'foo && bar || baz' != 'if foo; then bar; else baz; fi'

also add more error handling


Modified: branches/Branch_5_1/src/debian/rules
===================================================================
--- branches/Branch_5_1/src/debian/rules	2012-07-11 08:09:09 UTC (rev 15983)
+++ branches/Branch_5_1/src/debian/rules	2012-07-12 11:25:41 UTC (rev 15984)
@@ -82,16 +82,24 @@
 conffiles: $(PPOSTINST) $(PPRERM) $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) $(READMEFILES) $(PCRONDFILES) $(PDIRSFILES) $(PLINKSFILES) $(PINSTALLFILES) $(PDOCSFILES) $(PTRIGGERSFILES) debian/control
 
 debian/$(PACKAGE)-plugin-%.postinst:
-	export PLUGLONGNAME="`cat $(CURDIR)/plugins/$*/NAME`"; \
-		[ -e $(CURDIR)/plugins/$*/debian/plugin-$*.postinst ] \
-		&& $(SED_REPLACE) -e 's/@PLUGSHORTNAME@/$*/g' -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" $(CURDIR)/plugins/$*/debian/plugin-$*.postinst > $@ \
-		|| $(SED_REPLACE) -e 's/@PLUGSHORTNAME@/$*/g' -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" $(CURDIR)/debian/dsf-in/plugin.postinst > $@
+	PLUGLONGNAME="$$(cat '$(CURDIR)/plugins/$*/NAME')"; \
+	    test -n "$$PLUGLONGNAME" || exit 1; \
+	    srcf='$(CURDIR)/plugins/$*/debian/plugin-$*.postinst'; \
+	    test -e "$$srcf" || srcf='$(CURDIR)/debian/dsf-in/plugin.postinst'; \
+	    $(SED_REPLACE) \
+	    -e 's/@PLUGSHORTNAME@/$*/g' \
+	    -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" \
+	    "$$srcf" >$@ || (rm -f $@; exit 1)
 
 debian/$(PACKAGE)-plugin-%.prerm:
-	export PLUGLONGNAME="`cat $(CURDIR)/plugins/$*/NAME`"; \
-		[ -e $(CURDIR)/plugins/$*/debian/plugin-$*.prerm ] \
-		&& $(SED_REPLACE) -e 's/@PLUGSHORTNAME@/$*/g' -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" $(CURDIR)/plugins/$*/debian/plugin-$*.prerm > $@ \
-		|| $(SED_REPLACE) -e 's/@PLUGSHORTNAME@/$*/g' -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" $(CURDIR)/debian/dsf-in/plugin.prerm > $@
+	PLUGLONGNAME="$$(cat '$(CURDIR)/plugins/$*/NAME')"; \
+	    test -n "$$PLUGLONGNAME" || exit 1; \
+	    srcf='$(CURDIR)/plugins/$*/debian/plugin-$*.prerm'; \
+	    test -e "$$srcf" || srcf='$(CURDIR)/debian/dsf-in/plugin.prerm'; \
+	    $(SED_REPLACE) \
+	    -e 's/@PLUGSHORTNAME@/$*/g' \
+	    -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" \
+	    "$$srcf" >$@ || (rm -f $@; exit 1)
 
 debian/$(PACKAGE)-plugin-%.cron.d:
 	$(SED_REPLACE) -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/plugins/$*/packaging/cron.d/plugin-$* > $@
@@ -104,13 +112,13 @@
 	$(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/dirs/plugin-$* > $@
 
 debian/$(OLDPACKAGE)-%.dirs:
-	$(SED_REPLACE) $(CURDIR)/packaging/dirs/$* > $@ 
+	$(SED_REPLACE) $(CURDIR)/packaging/dirs/$* > $@
 
 debian/$(PACKAGE)-plugin-%.links:
 	$(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/links/plugin-$* > $@
 
 debian/$(OLDPACKAGE)-%.links:
-	$(SED_REPLACE) $(CURDIR)/packaging/links/$* > $@ 
+	$(SED_REPLACE) $(CURDIR)/packaging/links/$* > $@
 
 debian/$(PACKAGE)-plugin-%.install:
 	$(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/install/plugin-$* > $@
@@ -119,7 +127,7 @@
 	$(SED_REPLACE) $(CURDIR)/plugins/$*/debian/plugin-$*.triggers > $@
 
 debian/$(OLDPACKAGE)-%.install:
-	$(SED_REPLACE) $(CURDIR)/packaging/install/$* > $@ 
+	$(SED_REPLACE) $(CURDIR)/packaging/install/$* > $@
 
 debian/$(PACKAGE)-plugin-%.docs:
 	$(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/docs/plugin-$* > $@




More information about the Fusionforge-commits mailing list