[ostree] sysroot: Handle deleting directories in /etc



commit b2a98f4ca3a8fcaa0c3c29ce8280c3f5a71a0464
Author: Colin Walters <walters verbum org>
Date:   Tue Oct 15 14:11:43 2013 -0400

    sysroot: Handle deleting directories in /etc
    
    We need to use the full shutil_rm_rf() in order to actually delete
    complete directories.
    
    Test suite code based on a patch from Sjoerd Simons <sjored luon net>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710097

 src/libostree/ostree-sysroot-deploy.c |    2 +-
 tests/libtest.sh                      |    2 ++
 tests/test-admin-deploy-1.sh          |    1 +
 3 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index f53bc2c..e36a619 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -161,7 +161,7 @@ merge_etc_changes (GFile          *orig_etc,
       g_assert (path);
       target_file = g_file_resolve_relative_path (new_etc, path);
 
-      if (!ot_gfile_ensure_unlinked (target_file, cancellable, error))
+      if (!gs_shutil_rm_rf (target_file, cancellable, error))
         goto out;
     }
 
diff --git a/tests/libtest.sh b/tests/libtest.sh
index 05cc01a..8c5a784 100644
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -218,6 +218,8 @@ EOF
     echo "a config file" > usr/etc/aconfigfile
     mkdir -p usr/etc/NetworkManager
     echo "a default daemon file" > usr/etc/NetworkManager/nm.conf
+    mkdir -p usr/etc/testdirectory
+    echo "a default daemon file" > usr/etc/testdirectory/test
 
     ostree --repo=${test_tmpdir}/testos-repo commit -b testos/buildmaster/x86_64-runtime -s "Build"
     
diff --git a/tests/test-admin-deploy-1.sh b/tests/test-admin-deploy-1.sh
index 02f5b20..e591f9b 100755
--- a/tests/test-admin-deploy-1.sh
+++ b/tests/test-admin-deploy-1.sh
@@ -101,6 +101,7 @@ ostree admin --sysroot=sysroot status
 echo "ok fourth deploy (retain)"
 
 echo "a new local config file" > sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/a-new-config-file
+rm -r  sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/testdirectory
 rm sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/aconfigfile
 ln -s /ENOENT sysroot/ostree/deploy/testos/deploy/${rev}.3/etc/a-new-broken-symlink
 ostree admin --sysroot=sysroot deploy --retain --os=testos testos:testos/buildmaster/x86_64-runtime


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