from .system import system
from .constants import *
from .i18n import _
-from .errors import BuildError, Error
+from .errors import *
BUILD_LOG_HEADER = """
self.log.debug("Running stage '%s'" % stage)
# Run it
- self.pakfire.execute_script(script, logging_callback=self.log.log,
- enable_network=False, interactive=False)
+ try:
+ self.pakfire.execute_script(script, logging_callback=self.log.log,
+ enable_network=False, interactive=False)
+
+ # Handle if the build script failed
+ except CommandExecutionError as e:
+ # Drop into a shell if requested
+ if shell:
+ self.pakfire.execute(["/usr/bin/bash", "--login"],
+ environ=self.environ, enable_network=True, interactive=True)
+
+ # Raise otherwise
+ raise e
def shell(self, packages=[], install=None):
archives = []
from .i18n import _
-from ._pakfire import DependencyError
+from ._pakfire import (
+ CommandExecutionError,
+ DependencyError,
+)
class commandTimeoutExpired(Exception):
pass # XXX cannot be as is