[Pkg-ceph-commits] [ceph] 02/03: Rejig a bit more to deal with dir->file switch

James Downing Page jamespage at moszumanska.debian.org
Mon Jun 13 11:03:56 UTC 2016


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

jamespage pushed a commit to branch ubuntu-xenial
in repository ceph.

commit c514b759a9fe8a4ed95bef680e8346870d615805
Author: James Page <james.page at ubuntu.com>
Date:   Mon Jun 13 11:29:50 2016 +0100

    Rejig a bit more to deal with dir->file switch
    
    (cherry picked from commit 6749f835952753a9975b52c4d0d2398fb94c0cb6)
---
 debian/ceph-common.postinst | 5 ++---
 debian/ceph-common.postrm   | 3 ++-
 debian/ceph-common.preinst  | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/debian/ceph-common.postinst b/debian/ceph-common.postinst
index 90f318b..246249d 100644
--- a/debian/ceph-common.postinst
+++ b/debian/ceph-common.postinst
@@ -37,9 +37,9 @@ set -e
 # Custom dpkg-maintscript-helper type function to deal with
 # nested /etc/default/ceph/ceph
 finish_mv_ceph_defaults() {
-    rm -rf "/etc/default/ceph/ceph.dpkg-remove"
+    rm -rf "/etc/default/ceph.dpkg-old/ceph.dpkg-remove"
 
-    [ -e "/etc/default/ceph/ceph" ] || return 0
+    [ -e "/etc/default/ceph.dpkg-old/ceph" ] || return 0
 
     echo "Preserving user changes to /etc/default/ceph (renamed from /etc/default/ceph/ceph)..."
     if [ -f "/etc/default/ceph" ]; then
@@ -47,7 +47,6 @@ finish_mv_ceph_defaults() {
     fi
     # Preserve /etc/default/ceph directory just in case users
     # have added additional files to it.
-    mv -f "/etc/default/ceph" "/etc/default/ceph.dpkg-old"
     mv -f "/etc/default/ceph.dpkg-old/ceph" "/etc/default/ceph"
 }
 
diff --git a/debian/ceph-common.postrm b/debian/ceph-common.postrm
index 0236ba1..3277de6 100644
--- a/debian/ceph-common.postrm
+++ b/debian/ceph-common.postrm
@@ -22,8 +22,9 @@ set -e
 # Custom dpkg-maintscript-helper type function to deal with
 # nested /etc/default/ceph/ceph
 abort_mv_ceph_defaults() {
-    if [ -e "/etc/default/ceph/ceph.dpkg-remove" ]; then
+    if [ -e "/etc/default/ceph.dpkg-old/ceph.dpkg-remove" ]; then
         echo "Reinstalling /etc/default/ceph/ceph that was moved away"
+        mv "/etc/default/ceph.dpkg-old" "/etc/default/ceph"
         mv "/etc/default/ceph/ceph.dpkg-remove" "/etc/default/ceph/ceph"
     fi
 }
diff --git a/debian/ceph-common.preinst b/debian/ceph-common.preinst
index 7ed17fb..51e3800 100644
--- a/debian/ceph-common.preinst
+++ b/debian/ceph-common.preinst
@@ -11,6 +11,7 @@ prepare_mv_ceph_defaults() {
         sed -n -e "\'^ /etc/default/ceph/ceph ' { s/ obsolete$//; s/.* //; p }")"
     if [ "$md5sum" = "$old_md5sum" ]; then
         mv -f "/etc/default/ceph/ceph" "/etc/default/ceph/ceph.dpkg-remove"
+        mv -f "/etc/default/ceph" "/etc/default/ceph.dpkg-old"
     fi
 }
 

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



More information about the Pkg-ceph-commits mailing list