@@ -70,10 +70,10 @@ PATCH_VIA_GERRIT_OPTS=${OPTS}
7070EOF
7171
7272# And stick the build-properties into git for remote toy builders
73- if [ ! -d toy-build-properties ]; then
74- git clone ssh://github.com/couchbasebuild/toy-build-properties
73+ if [ ! -d toy-build-manifests ]; then
74+ git clone ssh://github.com/couchbasebuild/toy-build-manifests
7575fi
76- pushd toy-build-properties
76+ pushd toy-build-manifests
7777git fetch --all && git reset --hard origin/master
7878mkdir -p ${PRODUCT_PATH} /${RELEASE}
7979cp ../build.properties ${PRODUCT_PATH} /${RELEASE} /${VERSION} .properties
@@ -123,18 +123,28 @@ if [ -e "${PRODUCT_CONFIG}" ]; then
123123 done
124124fi
125125
126- echo " Removing any broken symlinks"
127- echo ============================
128- # Since we dereference symlinks below, any broken symlinks will cause tar to
129- # fail with a mysterious "file deleted before we read it" error. Seems
130- # probably best just to remove them.
131- find . -xtype l -delete
126+ if [ " ${KEEP_GIT} " = " True" ]; then
127+ exclude_git_arg=" "
128+ set +x
129+ # As with build_from_manifest.py, we dereference symlinks in .git
130+ # directories so they work on Windows.
131+ echo " Dereferencing .git symlinks"
132+ echo =======================
133+ # Make a local temp file
134+ tempfile=./tmpgitfile
135+ find . -type l -path ' */.git/*' -print0 | while read -rd $' \0' file; do
136+ cp -aL " ${file} " ${tempfile}
137+ rm " ${file} "
138+ mv ${tempfile} " ${file} "
139+ done
140+ set -x
141+ else
142+ exclude_git_arg=" --exclude .repo --exclude-vcs"
143+ fi
132144
133145echo " Creating source tarball"
134146echo =======================
135- # As with build_from_manifest.py, we dereference symlinks so .git directories
136- # will work on Windows. As such, we don't actually need the .repo directory.
137- tar --create --file ../source.tar.gz --gzip --dereference --exclude .repo .[A-z]* *
147+ tar --create --file ../source.tar.gz --gzip ${exclude_git_arg} .[A-z]* *
138148
139149# Create final deliverables at WORKSPACE level
140150popd
0 commit comments