'postedit': '',
'postexport': '',
'postimport': '',
+ 'postunpack': '',
'posttag': '',
'pq-from': 'DEBIAN',
'prebuild': '',
'postimport':
"hook run after a successful import, "
"default is '%(postimport)s'",
+ 'postunpack':
+ "hook run after a unpacking the tarballs, "
+ "default is '%(postimport)s'",
'hooks':
"Enable running all hooks, default is %(hooks)s",
'time-machine':
extra_env=env)()
+def postunpack_hook(repo, tmp_dir, options):
+ if options.postunpack:
+ Hook('Postunpack', options.postunpack,
+ extra_env={'GBP_GIT_DIR': repo.git_dir,
+ 'GBP_TMP_DIR': tmp_dir}
+ )(dir=tmp_dir)
+
+
def is_30_quilt(repo, options):
format_file = DebianSourceFormat.format_file
try:
import_group.add_config_file_option("component", action="append", metavar='COMPONENT',
dest="components")
cmd_group.add_config_file_option(option_name="postimport", dest="postimport")
+ cmd_group.add_config_file_option(option_name="postunpack", dest="postunpack")
parser.add_boolean_config_file_option(option_name="interactive",
dest='interactive')
set_bare_repo_options(options)
upstream, tmpdir = unpack_tarballs(name, upstream, version, component_tarballs, options)
+ try:
+ postunpack_hook(repo, tmpdir, options)
+ except gbpc.CommandExecFailed:
+ raise GbpError() # The hook already printed an error message
(pristine_orig, linked) = prepare_pristine_tar(upstream.path,
name,
orig = self._orig('2.8')
ok_(import_orig(['arg0',
'--postimport=printenv > ../postimport.out',
+ '--postunpack=printenv > ../postunpack.out',
'--no-interactive', '--pristine-tar', orig]) == 0)
self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'],
tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8'])