gsrc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gsrc-commit] /srv/bzr/gsrc/trunk r1346: check for successful DESTDIR in


From: Brandon Invergo
Subject: [Gsrc-commit] /srv/bzr/gsrc/trunk r1346: check for successful DESTDIR install before doing sysinstall
Date: Fri, 07 Dec 2012 23:29:09 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 1346
committer: Brandon Invergo <address@hidden>
branch nick: trunk
timestamp: Fri 2012-12-07 23:29:09 +0100
message:
  check for successful DESTDIR install before doing sysinstall
modified:
  gar.lib.mk
=== modified file 'gar.lib.mk'
--- a/gar.lib.mk        2012-12-07 21:34:45 +0000
+++ b/gar.lib.mk        2012-12-07 22:29:09 +0000
@@ -904,7 +904,7 @@
 
 #################### SYS-INSTALL RULES ####################
 
-SYSINSTALL_TARGETS = normalise collisions packagevars install
+SYSINSTALL_TARGETS = check normalise collisions packagevars install
 
 # Some files which multiple packages seem to contain. These get
 # removed before stowing.
@@ -978,6 +978,18 @@
 PACKAGE_IDENT_FILES = \
        Makefile
 
+sysinstall-check:
+       @echo -e "[$(OK)sysinstall$(OFF)] $(MSG)Checking status of DESTDIR 
install$(OFF)"
+       @if [ "`ls $(packagedir)`" ]; then \
+               echo -e "[$(OK)sysinstall$(OFF)] $(MSG)Successful DESTDIR 
install$(OFF)"; \
+       else \
+               echo -e "[$(ERR)sysinstall$(OFF)] $(MSG)DESTDIR install failed, 
uninstalling$(OFF)"; \
+               $(MAKE) -C $(WORKOBJ) uninstall $(OUTPUT); \
+               exit 1; \
+       fi
+       $(MAKECOOKIE)
+
+
 sysinstall-collisions:
        @echo -e "[$(OK)sysinstall$(OFF)] $(MSG)Removing collisions$(OFF)"
        @rm -rf $(foreach FILE,$(COLLISIONS),$(packagedir)/$(FILE))
@@ -989,7 +1001,7 @@
        normalise () { \
                rmdir $$1 2>/dev/null || true; \
                if [ -d $$1 ]; then \
-                       echo "[$(OK)sysinstall$(OFF)] $(MSG)Moving contents of 
$$1 to $$2$(OFF)"; \
+                       echo -e "[$(OK)sysinstall$(OFF)] $(MSG)Moving contents 
of $$1 to $$2$(OFF)"; \
                        mkdir -p $$2; \
                        cp -a $$1/* $$2; \
                        rm -fr $$1; \
@@ -1018,7 +1030,7 @@
 
 sysinstall-uninstall:
        @rm -f $(COOKIEDIR)/sysinstall-*
-       @(test -d $(dotgardir) || (echo "[$(ERR)sysinstall$(OFF)] 
$(MSG)$(GARNAME) is not installed$(OFF)" && exit 1)) && \
+       @(test -d $(dotgardir) || (echo -e "[$(ERR)sysinstall$(OFF)] 
$(MSG)$(GARNAME) is not installed$(OFF)" && exit 1)) && \
        ( cd $(prefix) ; \
        test -f $(dotgardir)/FILES && rm -f -- `cat $(dotgardir)/FILES` 
$(OUTPUT); \
        test -f $(dotgardir)/DIRS && rmdir --ignore-fail-on-non-empty -v -- 
`cat $(dotgardir)/DIRS` $(OUTPUT) ; \


reply via email to

[Prev in Thread] Current Thread [Next in Thread]