Revision: 890 http://trac.macosforge.org/projects/darwinbuild/changeset/890 Author: wsiegrist@apple.com Date: 2010-09-29 08:47:51 -0700 (Wed, 29 Sep 2010) Log Message: ----------- Merge 8486662 Modified Paths: -------------- trunk/darwinup/Archive.cpp trunk/darwinup/Utils.cpp trunk/darwinup/Utils.h trunk/testing/darwinup/run-tests.sh Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/PR-4841388:399-419 /branches/PR-6358021:442-443 /branches/PR-6392966:423-427 /branches/PR-6398060:433-434 /branches/PR-6493844:460-461 /branches/PR-6497694:466-468,471 /branches/PR-6634286:632-650 /branches/PR-6688645:479-490 /branches/PR-6722857:495-499 /branches/PR-6729491:655-664 /branches/PR-6973110:804-813 /branches/PR-7250612:635-650 /branches/PR-7341154:682-694 /branches/PR-7431723:660-664 /branches/PR-7461534:650-664 /branches/PR-7482850:670-671 /branches/PR-7489777:676-731 /branches/PR-7529688:692-694 /branches/PR-7593824:739-772 /branches/PR-7598640:703-731 /branches/PR-7748469:777-785 /branches/PR-7765119:790-791 /branches/PR-7798586:796-799 /branches/PR-7872907:830-840 /branches/PR-7935095:819-821 /branches/PR-8116613:849 /branches/PR-8279204:854-862 /branches/PR-8416637:870-880 + /branches/PR-4841388:399-419 /branches/PR-6358021:442-443 /branches/PR-6392966:423-427 /branches/PR-6398060:433-434 /branches/PR-6493844:460-461 /branches/PR-6497694:466-468,471 /branches/PR-6634286:632-650 /branches/PR-6688645:479-490 /branches/PR-6722857:495-499 /branches/PR-6729491:655-664 /branches/PR-6973110:804-813 /branches/PR-7250612:635-650 /branches/PR-7341154:682-694 /branches/PR-7431723:660-664 /branches/PR-7461534:650-664 /branches/PR-7482850:670-671 /branches/PR-7489777:676-731 /branches/PR-7529688:692-694 /branches/PR-7593824:739-772 /branches/PR-7598640:703-731 /branches/PR-7748469:777-785 /branches/PR-7765119:790-791 /branches/PR-7798586:796-799 /branches/PR-7872907:830-840 /branches/PR-7935095:819-821 /branches/PR-8116613:849 /branches/PR-8279204:854-862 /branches/PR-8416637:870-880 /branches/PR-8486662:885-889 Modified: trunk/darwinup/Archive.cpp =================================================================== --- trunk/darwinup/Archive.cpp 2010-09-28 23:12:01 UTC (rev 889) +++ trunk/darwinup/Archive.cpp 2010-09-29 15:47:51 UTC (rev 890) @@ -300,7 +300,7 @@ } // use file extension to guess archive format - if (is_directory(actpath)) { + if (is_directory(actpath, true)) { archive = new DittoArchive(actpath); } else if (has_suffix(actpath, ".cpio")) { archive = new CpioArchive(actpath); Modified: trunk/darwinup/Utils.cpp =================================================================== --- trunk/darwinup/Utils.cpp 2010-09-28 23:12:01 UTC (rev 889) +++ trunk/darwinup/Utils.cpp 2010-09-29 15:47:51 UTC (rev 890) @@ -103,8 +103,17 @@ } int is_directory(const char* path) { + return is_directory(path, false); +} + +int is_directory(const char* path, bool followlinks) { struct stat sb; - int res = lstat(path, &sb); + int res = 0; + if (followlinks) { + res = stat(path, &sb); + } else { + res = lstat(path, &sb); + } return (res == 0 && S_ISDIR(sb.st_mode)); } Modified: trunk/darwinup/Utils.h =================================================================== --- trunk/darwinup/Utils.h 2010-09-28 23:12:01 UTC (rev 889) +++ trunk/darwinup/Utils.h 2010-09-29 15:47:51 UTC (rev 890) @@ -62,6 +62,7 @@ int mkdir_p(const char* path); int remove_directory(const char* path); int is_directory(const char* path); +int is_directory(const char* path, bool followlinks); int is_regular_file(const char* path); int is_url_path(const char* path); int is_userhost_path(const char* path); Modified: trunk/testing/darwinup/run-tests.sh =================================================================== --- trunk/testing/darwinup/run-tests.sh 2010-09-28 23:12:01 UTC (rev 889) +++ trunk/testing/darwinup/run-tests.sh 2010-09-29 15:47:51 UTC (rev 890) @@ -94,6 +94,19 @@ done fi +echo "========== TEST: Try installing a symlink-to-directory ==========" +ln -s root2 $PREFIX/root_link +# test without trailing slash +$DARWINUP install $PREFIX/root_link +$DARWINUP uninstall root_link +echo "DIFF: diffing original test files to dest (should be no diffs) ..." +$DIFF $ORIG $DEST 2>&1 +# test with trailing slash +$DARWINUP install $PREFIX/root_link/ +$DARWINUP uninstall root_link +echo "DIFF: diffing original test files to dest (should be no diffs) ..." +$DIFF $ORIG $DEST 2>&1 + echo "========== TEST: Trying roots one at a time ==========" for R in $ROOTS; do
participants (1)
-
source_changes@macosforge.org