Ron wrote: >On Sat, Aug 29, 2009 at 01:59:52PM -0300, David Bremner wrote:
>A PRE_HOOK:
>This would run in the TLD of the repo, prior to any export being
>performed. This isn't the hook you're looking for, since we have
>no knowledge of the package version et al. at that stage
I wonder if most of the things you mention will need DEB_SOURCE and
DEB_VERSION? I guess at least the "git status" check could happen
here, and some people obviously want that.
>A REPO_HOOK: (better names welcome)
>This would run in the TLD of the repo, after the debian branch is
>exported.
I thought about namings more suggestive of the sequencing of things,
but I think it doesn't matter much, and the next two could be in
parallel anyway.
>A SOURCE_HOOK: (ditto on the name for this one)
>This would run in the exported source tree, where the current
>HOOK_FILE does (and would simply replace that one). Probably
>this should actually be split into separate DEB_SOURCE_HOOK
>and ORIG_SOURCE_HOOK
If understand right, the ORIG_SOURCE_HOOK would not be run in the case
of re-using a tarball. This makes sense, but might be worth documenting.
I agree that running the same hook twice is suboptimal.
>Re your followup about making the p-t hook 'global': If you're going
>to do that, then it probably also needs some check for whether there
>really is p-t support in the repo that gitpkg is acting on.
pristine-tar does nothing if it cannot find a pristine-tar branch, so
it currently prints an error, and falls back on exporting as before.
I can certainly improve the error checking in the hook (see attached),
but this brings up the broader question of whether errors in hooks
should abort gitpkg. Presumably this is what people who want a
git-buildpackage style "abort-if-dirty" hook would want. I guess hooks
should just call 'exit 1' if that is what they want?
One more comment, it might be nice to accept these variables from the
environment, so at least for testing people can do
PRE_HOOK=${HOOKS}/dirty-tree.sh gitpkg master upstream
gitpkg-hook.sh
Description: Binary data

