]> andersk Git - config-package-dev.git/commitdiff
Use set -e in multi-statement Makefile commands.
authorAnders Kaseorg <andersk@mit.edu>
Sat, 4 Oct 2008 04:29:16 +0000 (04:29 +0000)
committerAnders Kaseorg <andersk@mit.edu>
Sat, 4 Oct 2008 04:29:16 +0000 (04:29 +0000)
git-svn-id: svn+ssh://svn.mit.edu/athena/trunk/debathena/debathena/config-package-dev@23197 728af825-273c-0410-89f9-f7d3b574a069

check-files.mk
debconf-divert.mk
debian/changelog
divert.mk
transform-files.mk

index d43b0a266c42088b125929c016fec90f57d2e492..e7e2ca6d24cc41fb34a99b1b92b6f4edbdd9902f 100644 (file)
@@ -66,6 +66,7 @@ $(call debian_check_files_tmp,%): $(truename)
        [ -n $(package) ]
        mkdir -p $(@D)
        cp "$(truename)" $@
+       set -e; \
        md5=$$(dpkg-query --showformat='$${Conffiles}\n' --show $(package) | \
            sed -n 's,^ $(name) \([0-9a-f]*\)$$,\1  $@, p'); \
        if [ -n "$$md5" ]; then \
index eb132c18946af2244d2daa8e5d02c5ffcc631584..fbb587c353ad2b9953c2c9bf5a93667f2c8a2877 100644 (file)
@@ -28,7 +28,8 @@ DEB_DEBCONF_HACK_PACKAGES += $(foreach package,$(DEB_ALL_PACKAGES), \
     $(if $(wildcard debian/$(package).debconf-hack),$(package)))
 
 $(patsubst %,debian-debconf-hack/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: debian-debconf-hack/%:
-       ( \
+       set -e; \
+       { \
            cat $(DEB_DEBCONF_HACK_SCRIPT); \
            echo 'if [ ! -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \
            echo '    debconf_get $(shell cut -d'       ' -f2 debian/$(cdbs_curpkg).debconf-hack) >/var/cache/$(cdbs_curpkg).debconf-save'; \
@@ -36,21 +37,23 @@ $(patsubst %,debian-debconf-hack/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: debian-debco
            sed 's/$$/  true/' debian/$(cdbs_curpkg).debconf-hack; \
            echo 'EOF'; \
            echo 'fi'; \
-       ) >> $(CURDIR)/debian/$(cdbs_curpkg).preinst.debhelper
-       ( \
+       } >> $(CURDIR)/debian/$(cdbs_curpkg).preinst.debhelper
+       set -e; \
+       { \
            cat $(DEB_DEBCONF_HACK_SCRIPT); \
            echo 'if [ -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \
            echo '    debconf_set </var/cache/$(cdbs_curpkg).debconf-save'; \
            echo '    rm -f /var/cache/$(cdbs_curpkg).debconf-save'; \
            echo 'fi'; \
-       ) >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
-       ( \
+       } >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
+       set -e; \
+       { \
            cat $(DEB_DEBCONF_HACK_SCRIPT); \
            echo 'if [ -f /var/cache/$(cdbs_curpkg).debconf-save ]; then'; \
            echo '    debconf_set </var/cache/$(cdbs_curpkg).debconf-save'; \
            echo '    rm -f /var/cache/$(cdbs_curpkg).debconf-save'; \
            echo 'fi'; \
-       ) >> $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper
+       } >> $(CURDIR)/debian/$(cdbs_curpkg).postrm.debhelper
 
 $(patsubst %,binary-fixup/%,$(DEB_DEBCONF_HACK_PACKAGES)) :: binary-fixup/%: debian-debconf-hack/%
 
index 5c5d2c24f3b194cb6aa2ab7877fad9c1c836a271..b29645610dfb899a9528fe9bd15b931bcdb7c7c7 100644 (file)
@@ -1,9 +1,13 @@
 config-package-dev (4.9) unstable; urgency=low
 
+  [ Tim Abbott ]
   * Fix destdir handling for multiple binary packages in
     DEB_TRANSFORM_FILES.
 
- -- Tim Abbott <tabbott@mit.edu>  Fri,  3 Oct 2008 23:43:49 -0400
+  [ Anders Kaseorg ]
+  * Use set -e in multi-statement Makefile commands.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Sat, 04 Oct 2008 00:28:23 -0400
 
 config-package-dev (4.8) unstable; urgency=low
 
index e387dcef232fce85b31cc868f9deff7604119ff1..7324bd4564a377f396bd5d88bf9ed86b078ba508 100644 (file)
--- a/divert.mk
+++ b/divert.mk
@@ -64,7 +64,8 @@ $(patsubst %,debian-divert/%,$(DEB_DIVERT_PACKAGES)) :: debian-divert/%:
 #   Writing shell scripts in makefiles sucks.  Remember to $$ shell
 #   variables and include \ at the end of each line.
 # Add code to postinst to add/remove diversions as appropriate
-       ( \
+       set -e; \
+       { \
            sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
            $(if $(divert_files_all), \
                echo 'if [ "$$1" = "configure" ]; then'; \
@@ -89,9 +90,10 @@ $(patsubst %,debian-divert/%,$(DEB_DIVERT_PACKAGES)) :: debian-divert/%:
                    echo "    divert_remove $(file) /usr/share/$(cdbs_curpkg)/`$(DEB_DIVERT_ENCODER) $(file)`";) \
                echo 'fi'; \
            ) \
-       ) >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
+       } >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
 # Add code to prerm script to undo diversions when package is removed.
-       ( \
+       set -e; \
+       { \
            sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
            $(if $(divert_files_thispkg), \
                echo 'if [ "$$1" = "remove" ]; then'; \
@@ -101,21 +103,22 @@ $(patsubst %,debian-divert/%,$(DEB_DIVERT_PACKAGES)) :: debian-divert/%:
                    echo "    undivert_unremove $(file) $(cdbs_curpkg)";) \
                echo 'fi'; \
            ) \
-       ) >> $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper
+       } >> $(CURDIR)/debian/$(cdbs_curpkg).prerm.debhelper
 # Add an encoding of the names of the diverted files to the Provides:
 # and Conflicts: lists.  This prevents two packages diverting the same
 # file from being installed simultaneously (it cannot work, and this
 # produces a much less ugly error).  Requires in debian/control:
 #   Provides: $(diverted-files)
 #   Conflicts: $(diverted-files)
-       ( \
+       set -e; \
+       { \
            echo -n "diverted-files="; \
            $(foreach file,$(divert_files_thispkg),\
                echo -n "diverts-"; \
                ${DEB_DIVERT_ENCODER} "$(call divert_files_replace_name,$(file))"; \
                echo -n ", ";) \
-           echo \
-       ) >> $(CURDIR)/debian/$(cdbs_curpkg).substvars
+           echo; \
+       } >> $(CURDIR)/debian/$(cdbs_curpkg).substvars
 
 $(patsubst %,binary-post-install/%,$(DEB_DIVERT_PACKAGES)) :: binary-post-install/%: debian-divert/%
 
index b8c9a9d518b9c32ad78ef52b346e8a66143d5299..c4a96d894ef7eb4ad25f6ff35def8ed7893fdcc6 100644 (file)
@@ -41,6 +41,7 @@ $(call debian_transform_files,%): $(call debian_check_files,%)
            debian/transform_$(notdir $(call undebian_transform_files,$@))) < $< > $@
 
 $(patsubst %,binary-install/%,$(DEB_ALL_PACKAGES)) :: binary-install/%:
+       set -e; \
        $(foreach file,$(DEB_TRANSFORM_FILES_$(cdbs_curpkg)), \
                install -d debian/$(cdbs_curpkg)/$(dir $(file)); \
                cp -a $(call debian_transform_files,$(file)) \
This page took 0.040501 seconds and 5 git commands to generate.