[darwinbuild-changes] [733] trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 4 14:32:29 PST 2010


Revision: 733
          http://trac.macosforge.org/projects/darwinbuild/changeset/733
Author:   wsiegrist at apple.com
Date:     2010-03-04 14:32:28 -0800 (Thu, 04 Mar 2010)
Log Message:
-----------
Fix stray directory bug by not saving parents for NoEntry files in rollback

Modified Paths:
--------------
    trunk/darwinup/Depot.cpp
    trunk/testing/darwinup/run-tests.sh

Added Paths:
-----------
    trunk/testing/darwinup/deep-rollback-2.xar
    trunk/testing/darwinup/deep-rollback.cpgz

Modified: trunk/darwinup/Depot.cpp
===================================================================
--- trunk/darwinup/Depot.cpp	2010-03-03 21:37:30 UTC (rev 732)
+++ trunk/darwinup/Depot.cpp	2010-03-04 22:32:28 UTC (rev 733)
@@ -437,28 +437,32 @@
 				}
 				assert(res == 0);
 
-				// need to save parent directories as well
-				FTSENT *pent = ent->fts_parent;
-				
-				// while we have a valid path that is below the prefix
-				while (pent && pent->fts_level >= 0) {
-					File* parent = FileFactory(rollback, pent);
+				if (!INFO_TEST(actual->info(), FILE_INFO_NO_ENTRY)) {
+					// need to save parent directories as well
+					FTSENT *pent = ent->fts_parent;
 					
-					// if parent dir does not exist, we are
-					//  generating a rollback of base system
-					//  which does not have matching directories,
-					//  so we can just move on.
-					if (!parent) {
-						IF_DEBUG("[analyze]      parent path not found, skipping parents\n");
-						break;
+					// while we have a valid path that is below the prefix
+					while (pent && pent->fts_level > 0) {
+						File* parent = FileFactory(rollback, pent);
+						
+						// if parent dir does not exist, we are
+						//  generating a rollback of base system
+						//  which does not have matching directories,
+						//  so we can just move on.
+						if (!parent) {
+							IF_DEBUG("[analyze]      parent path not found, skipping parents\n");
+							break;
+						}
+						
+						if (!this->has_file(rollback, parent)) {
+							IF_DEBUG("[analyze]      adding parent to rollback: %s \n", parent->path());
+							res = this->insert(rollback, parent);
+						}
+						assert(res == 0);
+						pent = pent->fts_parent;
 					}
-
-					if (!this->has_file(rollback, parent)) {
-						IF_DEBUG("[analyze]      adding parent to rollback: %s \n", parent->path());
-						res = this->insert(rollback, parent);
-					}
-					assert(res == 0);
-					pent = pent->fts_parent;
+				} else {
+					fprintf(stderr, "[analyze]      actual does not exist, no need to add parents to rollback\n");
 				}
 			}
 

Added: trunk/testing/darwinup/deep-rollback-2.xar
===================================================================
(Binary files differ)


Property changes on: trunk/testing/darwinup/deep-rollback-2.xar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/testing/darwinup/deep-rollback.cpgz
===================================================================
(Binary files differ)


Property changes on: trunk/testing/darwinup/deep-rollback.cpgz
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/testing/darwinup/run-tests.sh
===================================================================
--- trunk/testing/darwinup/run-tests.sh	2010-03-03 21:37:30 UTC (rev 732)
+++ trunk/testing/darwinup/run-tests.sh	2010-03-04 22:32:28 UTC (rev 733)
@@ -32,9 +32,9 @@
 	tar zxvf $R.tar.gz -C $PREFIX
 done;
 
-for R in 300dirs 300files;
+for R in 300dirs.tbz2 300files.tbz2 deep-rollback.cpgz deep-rollback-2.xar;
 do
-	cp $R.tbz2 $PREFIX/
+	cp $R $PREFIX/
 done;
 
 mkdir -p $ORIG
@@ -155,7 +155,28 @@
 stat $DEST/d/file
 rm $DEST/d/file
 rmdir $DEST/d
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
 
+echo "========== TEST: Deep rollback while saving user data =========="
+darwinup -vv -p $DEST install $PREFIX/deep-rollback.cpgz
+echo "modified" >> $DEST/d1/d2/d3/d4/d5/d6/file
+darwinup -vv -p $DEST install $PREFIX/deep-rollback.cpgz
+darwinup -vv -p $DEST uninstall newest
+darwinup -vv -p $DEST uninstall newest
+stat $DEST/d1/d2/d3/d4/d5/d6/file
+rm $DEST/d1/d2/d3/d4/d5/d6/file
+rm -rf $DEST/d1
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
+
+darwinup -vv -p $DEST install $PREFIX/deep-rollback.cpgz
+darwinup -vv -p $DEST install $PREFIX/deep-rollback-2.xar
+darwinup -vv -p $DEST uninstall all
+echo "DIFF: diffing original test files to dest (should be no diffs) ..."
+$DIFF $ORIG $DEST 2>&1
+
+
 echo "========== TEST: Testing broken symlink handling =========="
 darwinup -vv -p $DEST install $PREFIX/symlinks
 darwinup -vv -p $DEST uninstall symlinks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100304/d6b63f8b/attachment.html>


More information about the darwinbuild-changes mailing list