Code

src/Makefile.am: Make setcap and chmod fault-tolerant.
authorFlorian Forster <octo@verplant.org>
Thu, 10 Mar 2011 16:10:16 +0000 (17:10 +0100)
committerFlorian Forster <octo@verplant.org>
Thu, 10 Mar 2011 16:10:19 +0000 (17:10 +0100)
This is required because this weird Debian fakeroot utility gives the
impression as if the install was run by root, when in fact it isn't.
What good this should do is beyond me.

src/Makefile.am

index 29e7d92122010a7bba401b8cb8b24d289e24da6e..13267836f714d3e4686d01bcac44830cf9daea12 100644 (file)
@@ -56,11 +56,11 @@ install-exec-hook:
        @if test "x0" = "x$$UID"; then \
                if test "xLinux" = "x`uname -s`"; then \
                        echo "Setting CAP_NET_RAW capability on binaries."; \
-                       setcap cap_net_raw=ep $(DESTDIR)$(bindir)/oping; \
-                       setcap cap_net_raw=ep $(DESTDIR)$(bindir)/noping; \
+                       setcap cap_net_raw=ep $(DESTDIR)$(bindir)/oping || true; \
+                       setcap cap_net_raw=ep $(DESTDIR)$(bindir)/noping || true; \
                else \
                        echo "Setting set-UID bit on binaries."; \
-                       chmod u+s $(DESTDIR)$(bindir)/oping; \
-                       chmod u+s $(DESTDIR)$(bindir)/noping; \
+                       chmod u+s $(DESTDIR)$(bindir)/oping || true; \
+                       chmod u+s $(DESTDIR)$(bindir)/noping || true; \
                fi; \
        fi