Bug 1229729 - Make make-source-package.sh work on OS X. r=sfink
authorTill Schneidereit <till@tillschneidereit.net>
Tue, 01 Dec 2015 23:41:45 +0100
changeset 309585 e46e5a5717e81cc93148c519db3755deb1ccf7cd
parent 309584 57d9f788497722cb2fbd70d1831fec3a12485b59
child 309586 2e887a5f28f6c8ff8c0eb00eeaf11ec50ba1a4b3
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1229729
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1229729 - Make make-source-package.sh work on OS X. r=sfink
js/src/make-source-package.sh
--- a/js/src/make-source-package.sh
+++ b/js/src/make-source-package.sh
@@ -8,21 +8,21 @@ set -e
 : ${MAKE:=make}
 : ${MKDIR:=mkdir}
 : ${TAR:=tar}
 : ${SRCDIR:=$(cd $(dirname $0); pwd 2>/dev/null)}
 : ${MOZJS_NAME:=mozjs}
 : ${DIST:=/tmp/mozjs-src-pkg}
 
 if [[ -f "$SRCDIR/../../config/milestone.txt" ]]; then
-    MILESTONE="$(tail -1 $SRCDIR/../../config/milestone.txt)"
-    IFS=. read -a VERSION < <(echo "$MILESTONE")
-    MOZJS_MAJOR_VERSION=${MOZJS_MAJOR_VERSION:-${VERSION[0]}}
-    MOZJS_MINOR_VERSION=${MOZJS_MINOR_VERSION:-${VERSION[1]}}
-    MOZJS_PATCH_VERSION=${MOZJS_PATCH_VERSION:-${VERSION[2]}}
+	MILESTONE="$(tail -1 $SRCDIR/../../config/milestone.txt)"
+	IFS=. read -a VERSION < <(echo "$MILESTONE")
+	MOZJS_MAJOR_VERSION=${MOZJS_MAJOR_VERSION:-${VERSION[0]}}
+	MOZJS_MINOR_VERSION=${MOZJS_MINOR_VERSION:-${VERSION[1]}}
+	MOZJS_PATCH_VERSION=${MOZJS_PATCH_VERSION:-${VERSION[2]}}
 fi
 
 cmd=${1:-build}
 pkg="${MOZJS_NAME}-${MOZJS_MAJOR_VERSION}.${MOZJS_MINOR_VERSION}.${MOZJS_PATCH_VERSION:-${MOZJS_ALPHA:-0}}.tar.bz2"
 pkgpath=${pkg%.tar*}
 tgtpath=${DIST}/${pkgpath}
 taropts="-jcf"
 
@@ -43,97 +43,106 @@ echo ""
 TOPSRCDIR=${SRCDIR}/../..
 
 case $cmd in
 "clean")
 	echo "Cleaning ${pkg} and ${tgtpath} ..."
 	rm -rf ${pkg} ${tgtpath}
 	;;
 "build")
-        echo -n "Press enter to build $pkg> "
-        read
+	echo -n "Press enter to build $pkg> "
+	read
 
-        # Ensure that the configure script is newer than the configure.in script.
-        if [ ${SRCDIR}/configure.in -nt ${SRCDIR}/configure ]; then
-            echo "error: js/src/configure is out of date. Please regenerate before packaging." >&2
-            exit 1
-        fi
+	# Ensure that the configure script is newer than the configure.in script.
+	if [ ${SRCDIR}/configure.in -nt ${SRCDIR}/configure ]; then
+		echo "error: js/src/configure is out of date. Please regenerate before packaging." >&2
+		exit 1
+	fi
 
 	echo "Packaging source tarball ${pkg}..."
 	if [ -d ${tgtpath} ]; then
 		echo "WARNING - dist tree ${tgtpath} already exists!"
 	fi
 	${MKDIR} -p ${tgtpath}/js/src
 
 	# copy the embedded icu
 	${MKDIR} -p ${tgtpath}/intl
-	cp -t ${tgtpath}/intl -dRp ${TOPSRCDIR}/intl/icu
+	cp -pPR ${TOPSRCDIR}/intl/icu ${tgtpath}/intl
 
 	# copy main moz.build and Makefile.in
-	cp -t ${tgtpath} -dRp ${TOPSRCDIR}/Makefile.in ${TOPSRCDIR}/moz.build
+	cp -pPR ${TOPSRCDIR}/Makefile.in ${TOPSRCDIR}/moz.build ${tgtpath}
 
-        # copy nspr.
-        cp -t ${tgtpath} -dRP ${SRCDIR}/../../nsprpub
+	# copy nspr.
+	cp -pPR ${SRCDIR}/../../nsprpub ${tgtpath}
 
 	# copy build and config directory.
-	cp -t ${tgtpath} -dRp ${TOPSRCDIR}/build ${TOPSRCDIR}/config
+	cp -pPR ${TOPSRCDIR}/build ${TOPSRCDIR}/config ${tgtpath}
 
 	# put in js itself
-	cp -t ${tgtpath} -dRp ${TOPSRCDIR}/mfbt
-	cp -t ${tgtpath}/js -dRp ${SRCDIR}/../public
+	cp -pPR ${TOPSRCDIR}/mfbt ${tgtpath}
+	cp -pPR ${SRCDIR}/../public ${tgtpath}/js
 	find ${SRCDIR} -mindepth 1 -maxdepth 1 -not -path ${DIST} -a -not -name ${pkg} \
-		-exec cp -t ${tgtpath}/js/src -dRp {} +
+		-exec cp -pPR {} ${tgtpath}/js/src \;
 
 	# distclean if necessary
 	if [ -e ${tgtpath}/js/src/Makefile ]; then
 		${MAKE} -C ${tgtpath}/js/src distclean
 	fi
 
-	cp -t ${tgtpath} -dRp \
-		${TOPSRCDIR}/python
+	cp -pPR \
+		${TOPSRCDIR}/python \
+		${tgtpath}
 	${MKDIR} -p ${tgtpath}/dom/bindings
-	cp -t ${tgtpath}/dom/bindings -dRp \
-		${TOPSRCDIR}/dom/bindings/mozwebidlcodegen
+	cp -pPR \
+		${TOPSRCDIR}/dom/bindings/mozwebidlcodegen \
+		${tgtpath}/dom/bindings
 	${MKDIR} -p ${tgtpath}/media/webrtc/trunk/tools
-	cp -t ${tgtpath}/media/webrtc/trunk/tools -dRp \
-		${TOPSRCDIR}/media/webrtc/trunk/tools/gyp
+	cp -pPR \
+		${TOPSRCDIR}/media/webrtc/trunk/tools/gyp \
+		${tgtpath}/media/webrtc/trunk/tools
 	${MKDIR} -p ${tgtpath}/testing
-	cp -t ${tgtpath}/testing -dRp \
-		${TOPSRCDIR}/testing/mozbase
+	cp -pPR \
+		${TOPSRCDIR}/testing/mozbase \
+		${tgtpath}/testing
 	${MKDIR} -p ${tgtpath}/modules
-	cp -t ${tgtpath}/modules -dRp \
-		${TOPSRCDIR}/modules/zlib/src
+	cp -pPR \
+		${TOPSRCDIR}/modules/zlib/src \
+		${tgtpath}/modules
 	${MKDIR} -p ${tgtpath}/layout/tools/reftest
-	cp -t ${tgtpath}/layout/tools/reftest -dRp \
-	        ${TOPSRCDIR}/layout/tools/reftest/reftest
+	cp -pPR \
+		${TOPSRCDIR}/layout/tools/reftest/reftest \
+		${tgtpath}/layout/tools/reftest
 	${MKDIR} -p ${tgtpath}/toolkit/mozapps/installer
-	cp -t ${tgtpath}/toolkit/mozapps/installer -dRp \
-	        ${TOPSRCDIR}/toolkit/mozapps/installer/package-name.mk \
-	        ${TOPSRCDIR}/toolkit/mozapps/installer/upload-files.mk
+	cp -pPR \
+		${TOPSRCDIR}/toolkit/mozapps/installer/package-name.mk \
+		${TOPSRCDIR}/toolkit/mozapps/installer/upload-files.mk \
+		${tgtpath}/toolkit/mozapps/installer
 	${MKDIR} -p ${tgtpath}/mozglue
-	cp -t ${tgtpath}/mozglue -dRp \
-	        ${TOPSRCDIR}/mozglue/build \
-	        ${TOPSRCDIR}/mozglue/crt \
-	        ${TOPSRCDIR}/mozglue/misc \
-	        ${TOPSRCDIR}/mozglue/moz.build
-        ${MKDIR} -p ${tgtpath}/memory
-        cp -t ${tgtpath}/memory -dRp \
-                ${TOPSRCDIR}/memory/moz.build \
-                ${TOPSRCDIR}/memory/build \
-                ${TOPSRCDIR}/memory/fallible \
-                ${TOPSRCDIR}/memory/jemalloc \
-                ${TOPSRCDIR}/memory/mozalloc \
-                ${TOPSRCDIR}/memory/mozjemalloc
+	cp -pPR \
+		${TOPSRCDIR}/mozglue/build \
+		${TOPSRCDIR}/mozglue/crt \
+		${TOPSRCDIR}/mozglue/misc \
+		${TOPSRCDIR}/mozglue/moz.build \
+		${tgtpath}/mozglue
+	${MKDIR} -p ${tgtpath}/memory
+	cp -pPR \
+		${TOPSRCDIR}/memory/moz.build \
+		${TOPSRCDIR}/memory/build \
+		${TOPSRCDIR}/memory/fallible \
+		${TOPSRCDIR}/memory/jemalloc \
+		${TOPSRCDIR}/memory/mozalloc \
+		${TOPSRCDIR}/memory/mozjemalloc \
+		${tgtpath}/memory
 
 	# remove *.pyc and *.pyo files if any
 	find ${tgtpath} -type f -name "*.pyc" -o -name "*.pyo" |xargs rm -f
 
 	# copy or create INSTALL
 	if [ -e ${DIST}/INSTALL ]; then
-		cp -t ${tgtpath} ${DIST}/INSTALL
+		cp ${DIST}/INSTALL ${tgtpath}
 	else
 		cat <<INSTALL_EOF >${tgtpath}/INSTALL
 Full build documentation for SpiderMonkey is hosted on MDN:
   https://developer.mozilla.org/en-US/docs/SpiderMonkey/Build_Documentation
 
 Note that the libraries produced by the build system include symbols,
 causing the binaries to be extremely large. It is highly suggested that \`strip\`
 be run over the binaries before deploying them.
@@ -144,17 +153,17 @@ Building with default options may be per
   cd obj
   ../configure
   make # or mozmake on Windows
 INSTALL_EOF
 	fi
 
 	# copy or create README
 	if [ -e ${DIST}/README ]; then
-		cp -t ${tgtpath} ${DIST}/README
+		cp ${DIST}/README ${tgtpath}
 	else
 		cat <<README_EOF >${tgtpath}/README
 This directory contains SpiderMonkey ${MOZJS_MAJOR_VERSION}.
 
 This release is based on a revision of Mozilla ${MOZJS_MAJOR_VERSION}:
   http://hg.mozilla.org/releases/
 The changes in the patches/ directory were applied.
 
@@ -167,19 +176,19 @@ README_EOF
 	if [ -e ${TOPSRCDIR}/b2g/LICENSE ]; then
 		cp ${TOPSRCDIR}/b2g/LICENSE ${tgtpath}/
 	else
 		cp ${TOPSRCDIR}/LICENSE ${tgtpath}/
 	fi
 
 	# copy patches dir, if it currently exists in DIST
 	if [ -d ${DIST}/patches ]; then
-		cp -t ${tgtpath} -dRp ${DIST}/patches
+		cp -pPR ${DIST}/patches ${tgtpath}
 	elif [ -d ${TOPSRCDIR}/patches ]; then
-		cp -t ${tgtpath} -dRp ${TOPSRCDIR}/patches
+		cp -pPR ${TOPSRCDIR}/patches ${tgtpath}
 	fi
 
 	# Roll the tarball
 	${TAR} $taropts ${DIST}/../${pkg} -C ${DIST} ${pkgpath}
 	echo "Wrote $(cd ${DIST}/..; echo $PWD)/${pkg}"
 	;;
 *)
 	echo "Unrecognized command: $cmd"