fix: remove no longer existent /etc files from the right dir

This commit is contained in:
Rudra B.S. 2023-11-20 18:37:35 +05:30
parent 70ad8b5df7
commit 63e20638cf
2 changed files with 4 additions and 1 deletions

View file

@ -258,6 +258,8 @@ Server = {package_repo["repo-url"]}
if return_val == 0:
break
exec('cp', '/etc/mkinitcpio.conf', '/.new_rootfs/etc/mkinitcpio.conf')
counter = 0
while True:
return_val = exec_chroot('pacman', '-S', '--ask=4', *packages)

View file

@ -29,7 +29,8 @@ run_latehook() {
# Create new /etc.
rm -rf /new_root/.new_etc
cp -a /new_root/etc /new_root/.new_etc
(cd /new_root/etc && find . -type f -print0 | grep -Fxvz -f <(cd "/new_root/.update_rootfs/etc" && find . -type f) | xargs -0 rm -rf)
(cd /new_root/.new_etc && find . -type f -print0 | grep -Fxvz -f <(cd "/new_root/.update_rootfs/etc" && find . -type f) | xargs -0 rm -f)
(cd /new_root/.new_etc && find . -type l -print0 | grep -Fxvz -f <(cd "/new_root/.update_rootfs/etc" && find . -type l) | xargs -0 rm -f)
cp /new_root/.update_rootfs/etc/pacman.conf /new_root/.new_etc/pacman.conf
rm -rf /new_root/.new_etc/pacman.d
cp -a /new_root/.update_rootfs/etc/pacman.d /new_root/.new_etc/pacman.d