Skip to content

Commit

Permalink
Merge pull request #157 from mvo5/less-dpkg
Browse files Browse the repository at this point in the history
make "ubuntu-image snap" work even without dpkg installed
  • Loading branch information
sil2100 committed Aug 10, 2018
2 parents 5ba0bc5 + 7c214fd commit d5d1377
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ubuntu_image/__main__.py
Expand Up @@ -11,7 +11,7 @@
from ubuntu_image.assertion_builder import ModelAssertionBuilder
from ubuntu_image.classic_builder import ClassicBuilder
from ubuntu_image.helpers import (
DoesNotFit, PrivilegeError, as_size, get_host_arch,
DoesNotFit, PrivilegeError, as_size,
get_host_distro)
from ubuntu_image.hooks import HookError
from ubuntu_image.i18n import _
Expand Down Expand Up @@ -254,7 +254,7 @@ def parseargs(argv=None):
help=_("""Distribution name to be specified to livecd-rootfs."""))
classic_cmd.add_argument(
'-a', '--arch',
default=get_host_arch(), metavar='CPU-ARCHITECTURE',
default=None, metavar='CPU-ARCHITECTURE',
help=_("""CPU architecture to be specified to livecd-rootfs.
default value is builder arch."""))
classic_cmd.add_argument(
Expand Down
5 changes: 4 additions & 1 deletion ubuntu_image/classic_builder.py
Expand Up @@ -9,7 +9,7 @@
from tempfile import gettempdir
from ubuntu_image.common_builder import AbstractImageBuilderState
from ubuntu_image.helpers import (
check_root_privilege, live_build, run)
check_root_privilege, get_host_arch, live_build, run)
from ubuntu_image.parser import (
BootLoader, FileSystemType, StructureRole)

Expand Down Expand Up @@ -67,6 +67,9 @@ def prepare_image(self):
env['EXTRA_PPAS'] = self.args.extra_ppas
# Only genereate a single rootfs tree for classic image creation.
env['IMAGEFORMAT'] = 'none'
# ensure ARCH is set
if self.args.arch is None:
env['ARCH'] = get_host_arch()
live_build(self.unpackdir, env)
except CalledProcessError:
if self.args.debug:
Expand Down

0 comments on commit d5d1377

Please sign in to comment.