diff --git a/makechrootpkg.in b/makechrootpkg.in
index 2309be24eb3b192f347c123799ea9b5680332976..a6123be19b12574e9c133dd0f6ee9aaee69f0849 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -287,14 +287,16 @@ _chrootbuild() {
 	ln -sft /srcdest /srcdest_host/*
 	ln -sft /startdir /startdir_host/*
 
-	# XXX: Keep svn sources writable
+	# XXX: Keep bzr and svn sources writable
 	# Since makepkg 4.1.1 they get checked out via cp -a, copying the symlink
 	for dir in /srcdest /startdir; do
-		cd $dir
-		for svndir in */.svn; do
-			rm ${svndir%/.svn}
-			cp -a ${dir}_host/${svndir%/.svn} .
-			chown -R nobody ${svndir%/.svn}
+		for vcs in bzr svn; do
+			cd "$dir"
+			for vcsdir in */.$vcs; do
+				rm "${vcsdir%/.$vcs}"
+				cp -a "${dir}_host/${vcsdir%/.$vcs}" .
+				chown -R nobody "${vcsdir%/.$vcs}"
+			done
 		done
 	done