[darwinbuild-changes] [756] branches/PR-7593824/darwinup/Depot.cpp
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 10 09:14:32 PST 2010
Revision: 756
http://trac.macosforge.org/projects/darwinbuild/changeset/756
Author: wsiegrist at apple.com
Date: 2010-03-10 09:14:31 -0800 (Wed, 10 Mar 2010)
Log Message:
-----------
Cover more state cases during install and uninstall.
Modified Paths:
--------------
branches/PR-7593824/darwinup/Depot.cpp
Modified: branches/PR-7593824/darwinup/Depot.cpp
===================================================================
--- branches/PR-7593824/darwinup/Depot.cpp 2010-03-10 00:29:07 UTC (rev 755)
+++ branches/PR-7593824/darwinup/Depot.cpp 2010-03-10 17:14:31 UTC (rev 756)
@@ -370,7 +370,6 @@
char* actpath;
join_path(&actpath, this->prefix(), file->path());
File* actual = FileFactory(actpath);
-
File* preceding = this->file_preceded_by(file);
if (actual == NULL) {
@@ -428,6 +427,16 @@
}
}
}
+
+ // if file == actual, but actual != preceding, then an external
+ // process changed actual to be the same as what we are installing
+ // now (OS upgrade?). We do not need to save actual, but make
+ // a special state so the user knows what happened and does not
+ // get a ?.
+ if (actual_flags == FILE_INFO_IDENTICAL && preceding_flags != FILE_INFO_IDENTICAL) {
+ IF_DEBUG("[analyze] external changes but file same as actual\n");
+ state = 'E';
+ }
// XXX: should this be done in backup_file?
// If we're going to need to squirrel away data, create
@@ -792,9 +801,11 @@
IF_DEBUG("[uninstall] actual path is %s\n", actpath);
File* actual = FileFactory(actpath);
uint32_t flags = File::compare(file, actual);
-
- if (actual != NULL && flags != FILE_INFO_IDENTICAL) {
- // XXX: probably not the desired behavior
+
+ if (actual == NULL) {
+ IF_DEBUG("[uninstall] actual file missing, possibly due to parent being removed already\n");
+ state = '!';
+ } else if (flags != FILE_INFO_IDENTICAL) {
IF_DEBUG("[uninstall] changes since install; skipping\n");
} else {
File* superseded = context->depot->file_superseded_by(file);
@@ -817,6 +828,7 @@
} else if (INFO_TEST(flags, FILE_INFO_MODE_DIFFERS) ||
INFO_TEST(flags, FILE_INFO_GID_DIFFERS) ||
INFO_TEST(flags, FILE_INFO_UID_DIFFERS)) {
+ state = 'M';
if (res == 0) res = preceding->install_info(context->depot->m_prefix);
} else {
IF_DEBUG("[uninstall] no changes; leaving in place\n");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100310/0cc4d479/attachment.html>
More information about the darwinbuild-changes
mailing list