Browse Source

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
tags/v0.7.0
Sylvestre Ledru Michael Prokop 8 years ago
parent
commit
105fa476dc
2 changed files with 5 additions and 15 deletions
  1. +2
    -7
      scripts/generate-git-snapshot
  2. +3
    -8
      scripts/generate-svn-snapshot

+ 2
- 7
scripts/generate-git-snapshot View File

@@ -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"


+ 3
- 8
scripts/generate-svn-snapshot View File

@@ -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