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
This commit is contained in:
1 parent
3b700ccb50
commit
b2a98f4ca3
3 files changed
+4
-1
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user