apt: in dry-run code, also copy etc/apt/sources.list.d
In dry-run mode, we used to only copy etc/apt/sources.list to the fake overlay. However, if the host uses deb822, the sources.list file is usually empty. This patch also makes sure to copy the deb822 sources from etc/apt/sources.list.d/ Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
parent
9563b543ce
commit
ec29fa9a0a
|
@ -199,7 +199,11 @@ class DryRunMounter(Mounter):
|
|||
], check=True)
|
||||
if os.path.isdir(f'{target}/etc/apt/sources.list.d'):
|
||||
shutil.rmtree(f'{target}/etc/apt/sources.list.d')
|
||||
os.mkdir(f'{target}/etc/apt/sources.list.d')
|
||||
await arun_command([
|
||||
'cp', '-aT',
|
||||
f'{source}/etc/apt/sources.list.d',
|
||||
f'{target}/etc/apt/sources.list.d',
|
||||
], check=True)
|
||||
return OverlayMountpoint(
|
||||
lowers=[source],
|
||||
mountpoint=target,
|
||||
|
|
Loading…
Reference in New Issue