[PATCH] build fixes policykit support



Hi,

attached is a patch for the build system regarding policykit support

policy/Makefile.am
1.) removes duplicate copy, looks like a cut-n-paste error.
2.) removes trailing whitespace (after "echo failed")
3.) Uses "=" for comparison, "==" is a bashism
4.) Suppresses the output of the shell code (Using "@"). Only display the output of "echo".

configure.in
1.) Don't fail if polkit-policy-file-validate, set POLKIT_POLICY_FILE_VALIDATE to false

Validating the policy file only is required when running "make (dist)check). It's not required for a normal "./configure && make && make install".

Thus it's mostly interesting for the upstream author when creating the release tarballs. Normal users shouldn't be bothered having to install polkit-policy-file-validate.

Setting POLKIT_POLICY_FILE_VALIDATE = false if the binary is not found, ensures that the policy file cannot slip unvalidated into the release tarball.


Please review and apply.

Cheers,
Michael

--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Index: configure.in
===================================================================
--- configure.in	(Revision 3650)
+++ configure.in	(Arbeitskopie)
@@ -221,11 +221,7 @@
 
 PKG_CHECK_MODULES(POLKIT, polkit-dbus)
 
-AC_CHECK_PROG([POLKIT_POLICY_FILE_VALIDATE],
-    [polkit-policy-file-validate], [polkit-policy-file-validate])
-if test -z "$POLKIT_POLICY_FILE_VALIDATE"; then
-    AC_MSG_ERROR([polkit-policy-file-validate not found])
-fi
+AC_PATH_PROG([POLKIT_POLICY_FILE_VALIDATE], [polkit-policy-file-validate], [false])
 
 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
 AC_SUBST(GLIB_GENMARSHAL)
Index: policy/Makefile.am
===================================================================
--- policy/Makefile.am	(Revision 3650)
+++ policy/Makefile.am	(Arbeitskopie)
@@ -4,39 +4,18 @@
 	org.freedesktop.network-manager-settings.system.policy
 
 check:
-	for f in $(dist_polkit_policy_DATA); do \
+	@for f in $(dist_polkit_policy_DATA); do \
             echo -n "Validate PolicyKit policy in $$f : "; \
             $(POLKIT_POLICY_FILE_VALIDATE) $(srcdir)/$$f ; \
 	    ret=$$?; \
-            if  [ "$$ret" == "0" ]; \
+            if  [ "$$ret" = "0" ]; \
 	      then \
                 echo ok; \
             else \
-                echo failed; \ 
+                echo failed; \
 		exit 1; \
             fi; \
         done;
 
 clean-local :
 	rm -f *~
-polkit_policydir = $(datadir)/PolicyKit/policy
-
-dist_polkit_policy_DATA =    				\
-	org.freedesktop.network-manager-settings.system.policy
-
-check:
-	for f in $(dist_polkit_policy_DATA); do \
-            echo -n "Validate PolicyKit policy in $$f : "; \
-            $(POLKIT_POLICY_FILE_VALIDATE) $(srcdir)/$$f ; \
-	    ret=$$?; \
-            if  [ "$$ret" == "0" ]; \
-	      then \
-                echo ok; \
-            else \
-                echo failed; \ 
-		exit 1; \
-            fi; \
-        done;
-
-clean-local :
-	rm -f *~

Attachment: signature.asc
Description: OpenPGP digital signature



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