From cbbacc3e326902ebe89005e528191681f0003409 Mon Sep 17 00:00:00 2001
From: Russ Allbery <rra@debian.org>
Date: Sat, 24 Dec 2011 09:59:42 -0800
Subject: [PATCH] Don't fail in /usr/local creation example if chmod fails

* Fix the example of creating a /usr/local subdirectory to not fail if
  the chown or chmod fail.  Thanks, Joey Hess.  (Closes: #617315)
---
 debian/changelog |  2 ++
 policy.sgml      | 11 +++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index af931cc..f55de24 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,8 @@ debian-policy (3.9.3.0) UNRELEASED; urgency=low
   * Clarify that continuation lines of the Description control field must
     contain at least one non-whitespace character.  Thanks, Guillem Jover.
     (Closes: #627490)
+  * Fix the example of creating a /usr/local subdirectory to not fail if
+    the chown or chmod fail.  Thanks, Joey Hess.  (Closes: #617315)
   * Add the release date of 3.9.2.0 to upgrading-checklist.
   * Fix ordering of the last entries in the 3.9.2.0 upgrading-checklist.
   * Fix typo in upgrading-checklist entry for multiarch paths.  Thanks,
diff --git a/policy.sgml b/policy.sgml
index b8db0ab..4aeae36 100644
--- a/policy.sgml
+++ b/policy.sgml
@@ -6336,12 +6336,11 @@ install -m644 debian/shlibs.<var>package</var> debian/<var>package</var>/DEBIAN/
 	    For example, the <tt>emacsen-common</tt> package could
 	    contain something like
 	    <example compact="compact">
-if [ ! -e /usr/local/share/emacs ]
-then
-  if mkdir /usr/local/share/emacs 2>/dev/null
-  then
-    chown root:staff /usr/local/share/emacs
-    chmod 2775 /usr/local/share/emacs
+if [ ! -e /usr/local/share/emacs ]; then
+  if mkdir /usr/local/share/emacs 2>/dev/null; then
+    if chown root:staff /usr/local/share/emacs; then
+      chmod 2775 /usr/local/share/emacs || true
+    fi
   fi
 fi
 	    </example>
-- 
2.39.5