Raise NoBuildToolsFound.
This commit is contained in:
parent
1dac0c527a
commit
8133a5fa68
2 changed files with 15 additions and 15 deletions
|
@ -18,9 +18,9 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from . import (
|
from . import (
|
||||||
run_build, run_clean, run_install, run_test, NoBuildToolsFound,
|
run_build, run_clean, run_install, run_test,
|
||||||
note
|
note)
|
||||||
)
|
from .buildsystem import NoBuildToolsFound
|
||||||
from .dist import run_dist
|
from .dist import run_dist
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -419,7 +419,7 @@ def create_dist_schroot(
|
||||||
tree: Tree, target_dir: str,
|
tree: Tree, target_dir: str,
|
||||||
chroot: str, packaging_tree: Optional[Tree] = None,
|
chroot: str, packaging_tree: Optional[Tree] = None,
|
||||||
include_controldir: bool = True,
|
include_controldir: bool = True,
|
||||||
subdir: Optional[str] = None) -> Optional[str]:
|
subdir: Optional[str] = None) -> str:
|
||||||
if subdir is None:
|
if subdir is None:
|
||||||
subdir = 'package'
|
subdir = 'package'
|
||||||
with SchrootSession(chroot) as session:
|
with SchrootSession(chroot) as session:
|
||||||
|
@ -447,10 +447,6 @@ def create_dist_schroot(
|
||||||
try:
|
try:
|
||||||
session.chdir(os.path.join(reldir, subdir))
|
session.chdir(os.path.join(reldir, subdir))
|
||||||
run_dist(session)
|
run_dist(session)
|
||||||
except NoBuildToolsFound:
|
|
||||||
logging.info(
|
|
||||||
'No build tools found, falling back to simple export.')
|
|
||||||
return None
|
|
||||||
finally:
|
finally:
|
||||||
os.chdir(oldcwd)
|
os.chdir(oldcwd)
|
||||||
|
|
||||||
|
@ -495,11 +491,15 @@ if __name__ == '__main__':
|
||||||
packaging_tree = None
|
packaging_tree = None
|
||||||
subdir = None
|
subdir = None
|
||||||
|
|
||||||
ret = create_dist_schroot(
|
try:
|
||||||
tree, subdir=subdir, target_dir=os.path.abspath(args.target_directory),
|
ret = create_dist_schroot(
|
||||||
packaging_tree=packaging_tree,
|
tree, subdir=subdir,
|
||||||
chroot=args.chroot)
|
target_dir=os.path.abspath(args.target_directory),
|
||||||
if ret:
|
packaging_tree=packaging_tree,
|
||||||
sys.exit(0)
|
chroot=args.chroot)
|
||||||
|
except NoBuildToolsFound:
|
||||||
|
logging.info('No build tools found, falling back to simple export.')
|
||||||
|
export(tree, 'dist.tar.gz', 'tgz', None)
|
||||||
else:
|
else:
|
||||||
sys.exit(1)
|
print('Created %s' % ret)
|
||||||
|
sys.exit(0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue