[Pkg-libvirt-commits] [libvirt] 01/02: Don't fail chmod/chdir if a file doesn't exist

Guido Guenther agx at alioth.debian.org
Mon Oct 14 17:13:35 UTC 2013


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to annotated tag debian/1.1.3-2
in repository libvirt.

commit a2a1a74e4ef5ac2c23cb9ef5fc5b3c08701fd5a1
Author: Guido Günther <agx at sigxcpu.org>
Date:   Sun Oct 13 21:09:28 2013 +0200

    Don't fail chmod/chdir if a file doesn't exist
    
    We don't use -f since we want to detect other errors (ro filesystem,
    etc.)
    
    Closes: #726203
---
 debian/libvirt-bin.postinst |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/debian/libvirt-bin.postinst b/debian/libvirt-bin.postinst
index 79eb0cd..38ddae7 100644
--- a/debian/libvirt-bin.postinst
+++ b/debian/libvirt-bin.postinst
@@ -67,26 +67,26 @@ add_statoverrides()
 
     for dir in ${ROOT_DIRS}; do
         if ! dpkg-statoverride --list "${dir}" >/dev/null 2>&1; then
-            chown root:root "${dir}"
-            chmod 0711 "${dir}"
+            [ ! -e "${dir}" ] || chown root:root "${dir}"
+            [ ! -e "${dir}" ] || chmod 0711 "${dir}"
         fi
     done
 
     for dir in ${QEMU_DIRS}; do
         if ! dpkg-statoverride --list "${dir}" >/dev/null 2>&1; then
-            chown libvirt-qemu:libvirt-qemu "${dir}"
-            chmod 0750 "${dir}"
+            [ ! -e "${dir}" ] || chown libvirt-qemu:libvirt-qemu "${dir}"
+            [ ! -e "${dir}" ] || chmod 0750 "${dir}"
         fi
     done
 
     if ! dpkg-statoverride --list "${SANLOCK_DIR}" >/dev/null 2>&1; then
-        chown root:root "${SANLOCK_DIR}"
-        chmod 0700 "${SANLOCK_DIR}"
+        [ ! -e "${dir}" ] || chown root:root "${SANLOCK_DIR}"
+        [ ! -e "${dir}" ] || chmod 0700 "${SANLOCK_DIR}"
     fi
 
     if ! dpkg-statoverride --list "${QEMU_CONF}" >/dev/null 2>&1; then
-        chown root:root "${QEMU_CONF}"
-        chmod 0600 "${QEMU_CONF}"
+        [ ! -e "${dir}" ] || chown root:root "${QEMU_CONF}"
+        [ ! -e "${dir}" ] || chmod 0600 "${QEMU_CONF}"
     fi
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git



More information about the Pkg-libvirt-commits mailing list