Browse Source

support new APT sources format

The MMGen Project 2 months ago
parent
commit
75783ae8d6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      scripts/armbian_rootenc_setup.sh

+ 3 - 2
scripts/armbian_rootenc_setup.sh

@@ -1051,14 +1051,15 @@ _kernels_match() {
 }
 }
 
 
 copy_etc_files_distro_specific() {
 copy_etc_files_distro_specific() {
-	local files='/etc/apt/sources.list /etc/apt/sources.list.d/armbian.list'
+	local files="/etc/apt/sources.list $(echo /etc/apt/sources.list.d/*.{sources,list})"
 	if _distros_match; then
 	if _distros_match; then
 		for f in $files; do
 		for f in $files; do
-			_copy_to_target $f
+			[ -e "$f" ] && _copy_to_target $f
 		done
 		done
 	else
 	else
 		warn 'Warning: host and target distros do not match, attempting to rewrite files:'
 		warn 'Warning: host and target distros do not match, attempting to rewrite files:'
 		for f in $files; do
 		for f in $files; do
+			[ -e "$f" ] || continue
 			imsg "  rewriting $f"
 			imsg "  rewriting $f"
 			if [ "$target_armbian_keyring_signed" -a $(basename $f) == 'armbian.list' ]; then
 			if [ "$target_armbian_keyring_signed" -a $(basename $f) == 'armbian.list' ]; then
 				repl='deb [signed-by=\/usr\/share\/keyrings\/armbian.gpg] http'
 				repl='deb [signed-by=\/usr\/share\/keyrings\/armbian.gpg] http'