mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-12 03:41:08 +00:00
Make linux* wait on corresponding -meta package
We want to treat linux-$flavor and linux-meta-$flavor as one set in britney which goes in together or not at all. We never want to promote linux-$flavor without the accompanying linux-meta-$flavor. Introduce a synthetic linux* → linux-meta* dependency to enforce this grouping.
This commit is contained in:
parent
0a72e94198
commit
1ab16725df
21
britney.py
21
britney.py
@ -1152,6 +1152,27 @@ class Britney(object):
|
||||
parse_depends = apt_pkg.parse_depends
|
||||
get_dependency_solvers = self.get_dependency_solvers
|
||||
|
||||
# make linux* wait on corresponding -meta package
|
||||
if src.startswith('linux'):
|
||||
meta = src.replace('linux', 'linux-meta', 1)
|
||||
if meta in self.sources[suite]:
|
||||
# copy binary_u here, don't modify self.binaries!
|
||||
if binary_u[DEPENDS]:
|
||||
binary_u[DEPENDS] = binary_u[DEPENDS] + ', '
|
||||
else:
|
||||
binary_u[DEPENDS] = ''
|
||||
# find binary of our architecture
|
||||
binpkg = None
|
||||
for b in self.sources[suite][meta][BINARIES]:
|
||||
pkg, a = b.split('/')
|
||||
if a == arch:
|
||||
binpkg = pkg
|
||||
break
|
||||
if binpkg:
|
||||
binver = self.binaries[suite][arch][0][binpkg][SOURCEVER]
|
||||
binary_u[DEPENDS] += '%s (>= %s)' % (binpkg, binver)
|
||||
self.__log('Synthesizing dependency %s to %s: %s' % (meta, src, binary_u[DEPENDS]))
|
||||
|
||||
# analyze the dependency fields (if present)
|
||||
if not binary_u[DEPENDS]:
|
||||
return True
|
||||
|
@ -1448,6 +1448,54 @@ fancy 1 i386 linux-meta-lts-grumpy 1
|
||||
'debci-series-amd64:lxc {"triggers": ["linux-meta/1"]}',
|
||||
'debci-series-amd64:lxc {"triggers": ["linux-meta-64only/1"]}']))
|
||||
|
||||
def test_kernel_waits_on_meta(self):
|
||||
'''linux waits on linux-meta'''
|
||||
|
||||
self.data.add('dkms', False, {})
|
||||
self.data.add('fancy-dkms', False, {'Source': 'fancy', 'Depends': 'dkms (>= 1)'})
|
||||
self.data.add('linux-image-generic', False, {'Version': '0.1', 'Source': 'linux-meta', 'Depends': 'linux-image-1'})
|
||||
self.data.add('linux-image-1', False, {'Source': 'linux'}, testsuite='autopkgtest')
|
||||
self.data.add('linux-firmware', False, {'Source': 'linux-firmware'}, testsuite='autopkgtest')
|
||||
|
||||
self.swift.set_results({'autopkgtest-series': {
|
||||
'series/i386/l/linux/20150101_100000@': (0, 'linux 2', {'custom_environment': ['ADT_TEST_TRIGGERS=linux/2']}),
|
||||
'series/amd64/l/linux/20150101_100000@': (0, 'linux 2', {'custom_environment': ['ADT_TEST_TRIGGERS=linux/2']}),
|
||||
'series/i386/l/linux-firmware/20150101_100000@': (0, 'linux-firmware 2', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-firmware/2']}),
|
||||
'series/amd64/l/linux-firmware/20150101_100000@': (0, 'linux-firmware 2', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-firmware/2']}),
|
||||
}})
|
||||
|
||||
self.do_test(
|
||||
[('linux-image-generic', {'Version': '0.2', 'Source': 'linux-meta', 'Depends': 'linux-image-2'}, None),
|
||||
('linux-image-2', {'Version': '2', 'Source': 'linux'}, 'autopkgtest'),
|
||||
('linux-firmware', {'Version': '2', 'Source': 'linux-firmware'}, 'autopkgtest'),
|
||||
],
|
||||
{'linux-meta': (False, {'fancy 1': {'amd64': 'RUNNING', 'i386': 'RUNNING'}}),
|
||||
# tests pass, but should wait on linux-meta
|
||||
'linux': (False, {'linux 2': {'amd64': 'PASS', 'i386': 'PASS'}}),
|
||||
# this one does not have a -meta, so don't wait
|
||||
'linux-firmware': (True, {'linux-firmware 2': {'amd64': 'PASS', 'i386': 'PASS'}}),
|
||||
},
|
||||
{'linux': [('reason', 'depends'),
|
||||
('excuses', 'Depends: linux linux-meta (not considered)')]
|
||||
}
|
||||
)
|
||||
|
||||
# now linux-meta is ready to go
|
||||
self.swift.set_results({'autopkgtest-series': {
|
||||
'series/i386/f/fancy/20150101_100000@': (0, 'fancy 1', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-meta/0.2']}),
|
||||
'series/amd64/f/fancy/20150101_100000@': (0, 'fancy 1', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-meta/0.2']}),
|
||||
}})
|
||||
self.do_test(
|
||||
[],
|
||||
{'linux-meta': (True, {'fancy 1': {'amd64': 'PASS', 'i386': 'PASS'}}),
|
||||
'linux': (True, {'linux 2': {'amd64': 'PASS', 'i386': 'PASS'}}),
|
||||
'linux-firmware': (True, {'linux-firmware 2': {'amd64': 'PASS', 'i386': 'PASS'}}),
|
||||
},
|
||||
{'linux': [('excuses', 'Depends: linux linux-meta')]
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
################################################################
|
||||
# Tests for special-cased packages
|
||||
################################################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user