Skip to content

Commit

Permalink
Revert "Allow for architecture-specific packages (#876)" (#898)
Browse files Browse the repository at this point in the history
This reverts LP: #1637282 as the syntax does not allow us to
do deb multiarch.

This reverts commit 9d6f953.
  • Loading branch information
sergiusens authored Nov 11, 2016
1 parent c03401c commit 5ac5552
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 0 additions & 2 deletions docs/snapcraft-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ contain.
be staged before the dependent part starts its lifecycle.*
* `stage-packages` (list of strings)
A list of Ubuntu packages to use that would support the part creation.
To restrict to a specific architecture, use `pkg:arch`.
* `build-packages` (list of strings)
A list of Ubuntu packages to be installed on the host to aid in building
the part. These packages will not go into the final snap.
To restrict to a specific architecture, use `pkg:arch`.
* `filesets` (yaml subsection)
A dictionary with filesets, the key being a recognizable user defined
string and its value a list of strings of files to be included or
Expand Down
10 changes: 0 additions & 10 deletions snapcraft/internal/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,8 @@ def get(self, package_names):

def _get(self, apt_cache, package_names):
manifest_dep_names = self._manifest_dep_names(apt_cache)
deb_arch = snapcraft.ProjectOptions().deb_arch

for name in package_names:
fields = name.split(":", 2)
name = fields[0]

# Skip if the architecture doesn't match deb_arch
if len(fields) == 2 and fields[1] != deb_arch:
logger.debug('Skipping {!r} based on architecture filter'
.format(name))
continue

try:
logger.debug('Marking {!r} as to install'.format(name))
apt_cache[name].mark_install()
Expand Down
12 changes: 2 additions & 10 deletions snapcraft/tests/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def test_get_package(self, mock_apt):
project_options = snapcraft.ProjectOptions(
use_geoip=False)
ubuntu = repo.Ubuntu(self.tempdir, project_options=project_options)
ubuntu.get(['fake-package', 'fake-package-arch1:test',
'fake-package-arch2:%s' % project_options.deb_arch])
ubuntu.get(['fake-package'])

mock_apt.assert_has_calls([
call.apt_pkg.config.set('Dir::Cache::Archives',
Expand All @@ -65,14 +64,7 @@ def test_get_package(self, mock_apt):

# __getitem__ is tricky
self.assertIn(
call('fake-package'),
mock_apt.Cache().__getitem__.call_args_list)
self.assertNotIn(
call('fake-package-arch1'),
mock_apt.Cache().__getitem__.call_args_list)
self.assertIn(
call('fake-package-arch2'),
mock_apt.Cache().__getitem__.call_args_list)
call('fake-package'), mock_apt.Cache().__getitem__.call_args_list)

@patch('snapcraft.repo._get_geoip_country_code_prefix')
def test_sources_is_none_uses_default(self, mock_cc):
Expand Down

0 comments on commit 5ac5552

Please sign in to comment.