diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2020-03-05 16:04:49 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2020-08-25 18:19:45 +0200 |
commit | 9fc3f1b3edc9def944854206ebcf7dd51fd05185 (patch) | |
tree | eae684d79bae8f8bf147918278994d5c66ef8745 /gbp/scripts/import_orig.py | |
parent | 4e5fc40a00557b5adeef944e01e755cf86ab9325 (diff) |
import-orig: expose unpacked sources dir to the postunpack hook
Use an $GBP_SOURCES_DIR to expose the post-unpack sources dir to the hook.
Include a test that checks that all the expected env variables are set.
Diffstat (limited to 'gbp/scripts/import_orig.py')
-rw-r--r-- | gbp/scripts/import_orig.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py index 3a0d2d97..2947235a 100644 --- a/gbp/scripts/import_orig.py +++ b/gbp/scripts/import_orig.py @@ -227,11 +227,12 @@ def postimport_hook(repo, tag, version, options): extra_env=env)() -def postunpack_hook(repo, tmp_dir, options): +def postunpack_hook(repo, tmp_dir, sources, options): if options.postunpack: Hook('Postunpack', options.postunpack, extra_env={'GBP_GIT_DIR': repo.git_dir, - 'GBP_TMP_DIR': tmp_dir} + 'GBP_TMP_DIR': tmp_dir, + 'GBP_SOURCES_DIR': sources[0].unpacked} )(dir=tmp_dir) @@ -474,7 +475,7 @@ def main(argv): sources, tmpdir = unpack_tarballs(name, sources, version, options) try: - postunpack_hook(repo, tmpdir, options) + postunpack_hook(repo, tmpdir, sources, options) except gbpc.CommandExecFailed: raise GbpError() # The hook already printed an error message |