chroot: exclude all CHROOT_PATHS from rsync, keep leading slashes

This commit is contained in:
InsanePrawn 2022-05-05 21:22:53 +02:00
parent 560b5bcd45
commit 686c94c3ad

View file

@ -24,20 +24,10 @@ class BuildChroot(Chroot):
raise Exception('base_chroot == self, bailing out. this is a bug')
base_chroot.initialize()
logging.info(f'Copying {base_chroot.name} chroot to {self.name}')
result = subprocess.run([
'rsync',
'-a',
'--delete',
'-q',
'-W',
'-x',
'--exclude',
CHROOT_PATHS['pkgbuilds'].strip('/'),
'--exclude',
CHROOT_PATHS['packages'].strip('/'),
f'{base_chroot.path}/',
f'{self.path}/',
])
cmd = ['rsync', '-a', '--delete', '-q', '-W', '-x']
for mountpoint in CHROOT_PATHS:
cmd += ['--exclude', mountpoint.rstrip('/')]
result = subprocess.run(cmd + [f'{base_chroot.path}/', f'{self.path}/'])
if result.returncode != 0:
raise Exception(f'Failed to copy {base_chroot.name} to {self.name}')