Do not fail in absence of versioninfo

The tar command used do get the versioninfo content does not just
return empty when versioninfo is absent: it fails, triggering
set -e protection and resulting in the whole script failing. Fix
makes sure the command is successful (by || true) even when it
returns nothing.

Fixes bug 1018820

Change-Id: I3605d070f1d8f5bb39f5751f7c9a8b4f78a7701b
This commit is contained in:
Thierry Carrez 2012-06-28 14:28:16 +02:00
parent 610b472600
commit 40bed1816e

View File

@ -56,7 +56,7 @@ if [ -f setup.py ] ; then
# There should only be one, so this should be safe.
tarball=$(echo dist/*.tar.gz)
# If our tarball includes a versioninfo file, use that version
snapshotversion=`tar --wildcards -O -z -xf $tarball *versioninfo 2>/dev/null`
snapshotversion=`tar --wildcards -O -z -xf $tarball *versioninfo 2>/dev/null || true`
if [ "x${snapshotversion}" = "x" ] ; then
snapshotversion=$(find_next_version)
echo mv "$tarball" "dist/$(basename $tarball .tar.gz)${SEPARATOR}${snapshotversion}.tar.gz"