1
1

Some improvements to the make_dist_tarball script, particularly for hg

repos.

This commit was SVN r25913.
Этот коммит содержится в:
Jeff Squyres 2012-02-13 23:16:13 +00:00
родитель 9b6486f1ab
Коммит 3b299257b9

18
contrib/dist/make_dist_tarball поставляемый
Просмотреть файл

@ -313,6 +313,8 @@ fi
if test -d .svn; then if test -d .svn; then
echo "*** Removing old VERSION file..." echo "*** Removing old VERSION file..."
rm -f VERSION rm -f VERSION
echo "*** Restoring pristine VERSION file..."
svn revert VERSION
echo "*** Running svn up..." echo "*** Running svn up..."
svn up svn up
if test ! "$?" = "0"; then if test ! "$?" = "0"; then
@ -324,23 +326,33 @@ if test -d .svn; then
elif test -d .hg; then elif test -d .hg; then
echo "*** Removing old VERSION file..." echo "*** Removing old VERSION file..."
rm -f VERSION rm -f VERSION
echo "*** Running hg up..." echo "*** Restoring pristine VERSION file..."
hg revert VERSION hg revert VERSION
echo "*** Running hg up..."
hg up hg up
if test ! "$?" = "0"; then if test ! "$?" = "0"; then
echo "HG update failed. Aborting" echo "HG update failed. Aborting"
exit 1 exit 1
fi fi
echo "*** Getting hg version number..." echo "*** Getting hg version number..."
svn_r="r`svnversion .`" svn_r=hg`hg tip | grep ^changeset: | head -n 1 | cut -d: -f3`
fi
echo " Repo rev number: $svn_r"
if test "$svn_r" = ""; then
echo "Somehow the repo rev number is empty. Abort!"
exit 1
elif test "`echo $svn_r | grep ' '`" != ""; then
echo "Somehow the repo rev number has a space in it -- bad!"
exit 1
fi fi
# #
# Ditch "svn/hg" from all version numbers # Ditch "svn/hg" from all version numbers
# #
echo "*** Removing svn version numbers..." echo "*** Removing svn version numbers from VERSION..."
version_files=VERSION version_files=VERSION
release_date=`date '+%b %d, %Y'` release_date=`date '+%b %d, %Y'`
echo " Release date: $release_date"
for file in $version_files; do for file in $version_files; do
echo " - $file" echo " - $file"
sed -e 's/^want_repo_rev=.*/want_repo_rev=0/' \ sed -e 's/^want_repo_rev=.*/want_repo_rev=0/' \