[darwinbuild-changes] [192] trunk/darwinbuild/darwinbuild

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 4 01:57:11 PDT 2006


Revision: 192
          http://trac.macosforge.org/projects/darwinbuild/changeset/192
Author:   ssen
Date:     2006-10-04 01:57:11 -0700 (Wed, 04 Oct 2006)

Log Message:
-----------
Set shopt -s nullglob, which sanitizes some of the ways we
were checking directory contents.

Don't use --posix when patching, because that prevents
you from being able to create new files out of thin air during
patching.

Use resolveDeps -commit to write changes back to the
"properties" table.

Don't call InstallHeaders (for now), call InstallRoot

Modified Paths:
--------------
    trunk/darwinbuild/darwinbuild

Modified: trunk/darwinbuild/darwinbuild
===================================================================
--- trunk/darwinbuild/darwinbuild	2005-08-24 02:31:19 UTC (rev 191)
+++ trunk/darwinbuild/darwinbuild	2006-10-04 08:57:11 UTC (rev 192)
@@ -114,6 +114,8 @@
 
 . "$COMMONFILE"
 
+shopt -s nullglob
+
 ###
 ### DarwinBuild must be run as root.  Enforce this.
 ###
@@ -478,10 +480,10 @@
 	    esac
 	    case $patchfile in
 		*.p1.patch*)
-		    $catprog "$SourceCache/$patchfile" | patch --posix -l -p1
+		    $catprog "$SourceCache/$patchfile" | patch -l -f -p1
 		    ;;
 		*.patch*)
-		    $catprog "$SourceCache/$patchfile" | patch --posix -l -p0
+		    $catprog "$SourceCache/$patchfile" | patch -l -f -p0
 		    ;;
 		*)
 		    echo "Don't know how to apply $patchfile"
@@ -499,8 +501,8 @@
 ### Look for the build tool: make, xcodebuild
 ###
 
-numfiles=$(ls -d *.pbproj *.xcode *.xcodeproj 2> /dev/null | wc -l)
-if [ $numfiles != 0 ]; then
+numfiles=$(echo *.pbproj *.xcode *.xcodeproj 2> /dev/null )
+if [ -n "$numfiles" ]; then
 	buildtool="xcodebuild"
 else
 	buildtool="make"
@@ -531,7 +533,8 @@
 	echo "*** Installing Headers ..."
 	deps=$($DARWINXREF dependencies -header "$projnam")
 	for X in $deps ; do
-		InstallHeaders "$BuildRoot" "$X" "$depsbuild"
+#		InstallHeaders "$BuildRoot" "$X" "$depsbuild"
+		InstallRoot "$BuildRoot" "$X" "$depsbuild"
 	done
 
 	### xcodebuild is a special case because it is not open source
@@ -717,11 +720,11 @@
 
 ExitHandler() {
 	### Once for fdsec
-	[ "$(echo $BuildRoot/dev/*)" == "$BuildRoot/dev/*" ] || umount "$BuildRoot/dev"
+	[ -z "$(echo $BuildRoot/dev/*)" ] || umount "$BuildRoot/dev"
 	### Twice for devfs
-	[ "$(echo $BuildRoot/dev/*)" == "$BuildRoot/dev/*" ] || umount "$BuildRoot/dev"
+	[ -z "$(echo $BuildRoot/dev/*)" ] || umount "$BuildRoot/dev"
 	### Thrice for volfs
-	[ "$(echo $BuildRoot/.vol/*)" == "$BuildRoot/.vol/*" ] || chroot "$BuildRoot" umount /.vol
+	[ -z "$(echo $BuildRoot/.vol/*)" ] || chroot "$BuildRoot" umount /.vol
 }
 
 
@@ -736,6 +739,7 @@
 	###
 	echo "*** Mounting special filesystems ..."
 	trap ExitHandler EXIT
+
 	if [ ! -c "$BuildRoot/dev/null" ]; then
 		echo "Mounting devfs ..."
 		mkdir -p "$BuildRoot/dev"
@@ -752,7 +756,7 @@
  		[ -f "$BuildRoot/sbin/umount" ] || cp /sbin/umount "$BuildRoot/sbin/"
  		[ -d "$BuildRoot/.vol" ] || mkdir -p "$BuildRoot/.vol"
  		## If the directory is empty, assume volfs is not mounted
- 		[ "$(echo $BuildRoot/.vol/*)" == "$BuildRoot/.vol/*" ] && chroot "$BuildRoot" /sbin/mount_volfs "/.vol"
+ 		[ -n "$(echo $BuildRoot/.vol/*)" ] || chroot "$BuildRoot" /sbin/mount_volfs "/.vol"
  	fi
 
 	###
@@ -822,7 +826,7 @@
         		grep -vi  "^$TRACE_TYPES/dev/" | \
 			sort -u | \
 			"$DARWINXREF" loadDeps "$projnam" "$DARWIN_BUILDROOT/BuildRoot"
-			"$DARWINXREF" resolveDeps "$projnam"
+			"$DARWINXREF" resolveDeps -commit "$projnam"
 			cp "$TRACELOG" $DARWIN_BUILDROOT/Logs/$projnam/$project.trace~$build_version
 		fi
 	fi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/eecf97cf/attachment-0001.html


More information about the darwinbuild-changes mailing list