PRE_SOURCE_HOOK handling in generate-*-snapshot scripts: match behaviour and do not test if file exits

* Do not test if the file exist. It blocks the usage of 'export PRE_SOURCE_HOOK=/home/git/foo.sh version branch'
* Use the same declaration between generate-git-snapshot & generate-svn-snapshot
* Match the similar declaration in the git & svn scripts
remotes/origin/junit
Sylvestre Ledru 13 years ago committed by Michael Prokop
parent e5225b17a0
commit 105fa476dc

@ -232,13 +232,8 @@ echo "*** source package build phase ***"
rm -f ./* || true
if [ -n "${PRE_SOURCE_HOOK:-}" ] ; then
if ! [ -s "${PRE_SOURCE_HOOK:-}" ]; then
echo "Error: Could not find hook: ${PRE_SOURCE_HOOK:-}" >&2
exit 1
else
echo "*** Found environment variable PRE_SOURCE_HOOK, set to ${PRE_SOURCE_HOOK:-} ***"
sh "${PRE_SOURCE_HOOK:-}"
fi
echo "*** Found environment variable PRE_SOURCE_HOOK, set to ${PRE_SOURCE_HOOK:-} ***"
sh ${PRE_SOURCE_HOOK:-}
fi
cd "$SOURCE_DIRECTORY"

@ -162,14 +162,9 @@ if [ "${debian_only:-}" = "1" ] ; then
--svn-ignore-new -rfakeroot
)
else
if ! [ -z "${PRE_SOURCE_HOOK:-}" ] ; then
if ! [ -s "${PRE_SOURCE_HOOK:-}" ]; then
echo "Error: Could not find hook: ${PRE_SOURCE_HOOK:-}" >&2
exit 1
else
echo "*** Found environment variable PRE_SOURCE_HOOK, set to ${PRE_SOURCE_HOOK:-} ***"
sh "${PRE_SOURCE_HOOK:-}"
fi
if [ -n "${PRE_SOURCE_HOOK:-}" ] ; then
echo "*** Found environment variable PRE_SOURCE_HOOK, set to ${PRE_SOURCE_HOOK:-} ***"
sh ${PRE_SOURCE_HOOK:-}
fi
dpkg-source --tar-ignore=\.svn -b source/${branch:-}

Loading…
Cancel
Save