X-Debbugs-CC: Samuel Thibault <sthiba...@debian.org>, наб 
<nabijaczlew...@nabijaczleweli.xyz>

Hi,

Here is an updated proposal for a patch :

Source indices and 'non-free' and 'contrib' components
are missing in the Debian-Ports repository.
We may use a default repository (deb.debian.org/debian)
when installing on these architectures.

Regards,
JH Chatenet


Le mardi 28 juillet à 12h 51mn 41s (+0200), jhcha54008 a écrit :
> Hi,
> 
> In the present state of debian-installer apt-mirror-setup
> creates some non functional entries in /etc/apt/sources.list
> when installing on an architecture from the Debian-Ports repository.
> 
> Here are the three last lines in my /etc/apt/sources.list :
> 
> deb-src http://debian.inf.tu-dresden.de/debian-ports/ sid main
> # 'unreleased' does not support sources yet
> # deb-src http://debian.inf.tu-dresden.de/debian-ports/ unreleased main
> 
> and apt-get update outputs a warning :
> 
> W: Skipping acquire of configured file 'main/source/Sources' as repository 
> 'http://debian.inf.tu-dresden.de/debian-ports sid InRelease' does not seem to 
> provide it (sources.list entry misspelt?)
> 
> The source indices are not on the debian-ports mirrors but
> on the regular debian mirrors. Perhaps a line pointing to a
> default repository would help.
> 
> There is no non-free nor contrib components either. Some non-free 
> firmwares may be useful though.
> If the user selects non-free and contrib (at low priority)
> a line is inserted in sources.list :
> 
> deb http://debian.inf.tu-dresden.de/debian-ports/ sid main non-free contrib
> 
> This results in a warning :
> 
> W: Skipping acquire of configured file 'non-free/binary-all/Packages' as 
> repository 'http://debian.inf.tu-dresden.de/debian-ports sid InRelease' 
> doesn't have the component 'non-free' (component misspelt in sources.list?)
> W: Skipping acquire of configured file 'non-free/binary-alpha/Packages' as 
> repository 'http://debian.inf.tu-dresden.de/debian-ports sid InRelease' 
> doesn't have the component 'non-free' (component misspelt in sources.list?)
> W: Skipping acquire of configured file 'non-free/i18n/Translation-en' as 
> repository 'http://debian.inf.tu-dresden.de/debian-ports sid InRelease' 
> doesn't have the component 'non-free' (component misspelt in sources.list?)
> W: Skipping acquire of configured file 'contrib/binary-alpha/Packages' as 
> repository 'http://debian.inf.tu-dresden.de/debian-ports sid InRelease' 
> doesn't have the component 'contrib' (component misspelt in sources.list?)
> W: Skipping acquire of configured file 'contrib/binary-all/Packages' as 
> repository 'http://debian.inf.tu-dresden.de/debian-ports sid InRelease' 
> doesn't have the component 'contrib' (component misspelt in sources.list?)
> W: Skipping acquire of configured file 'contrib/i18n/Translation-en' as 
> repository 'http://debian.inf.tu-dresden.de/debian-ports sid InRelease' 
> doesn't have the component 'contrib' (component misspelt in sources.list?)
> 
> I contemplate updating the patch previously attached to this bug
> report.
> 
> Regards,
> JH Chatenet


diff -Naur a/apt-setup-0.158/debian/control b/apt-setup-0.158/debian/control
--- a/apt-setup-0.158/debian/control    2020-07-05 21:34:06.000000000 +0200
+++ b/apt-setup-0.158/debian/control    2020-07-21 11:33:23.446944705 +0200
@@ -18,7 +18,7 @@
 Package: apt-mirror-setup
 Package-Type: udeb
 Architecture: all
-Depends: choose-mirror-bin, base-installer (>= 1.195), ${misc:Depends}
+Depends: choose-mirror-bin, ${misc:Depends}
 Description: set up a mirror in sources.list
 
 Package: apt-cdrom-setup
diff -Naur a/apt-setup-0.158/generators/50mirror 
b/apt-setup-0.158/generators/50mirror
--- a/apt-setup-0.158/generators/50mirror       2020-07-05 21:34:06.000000000 
+0200
+++ b/apt-setup-0.158/generators/50mirror       2020-07-21 11:41:10.109258758 
+0200
@@ -2,7 +2,6 @@
 set -e
 
 . /usr/share/debconf/confmodule
-. /usr/lib/base-installer/library.sh
 
 file="$1"
 
@@ -26,12 +25,10 @@
        fi
 }
 
-# For architectures in the Debian-Ports archive, sources.list has to include
-# an additional entry for the "unreleased" suite.
-unset use_unreleased
-if is_ports_architecture "$(chroot /target /usr/bin/dpkg 
--print-architecture)"; then
-       log "Debian-Ports architecture detected"
-       use_unreleased=yes
+# Settings for architectures in the Debian-Ports archive
+is_ports_architecture=
+if [ -r /usr/lib/choose-mirror/port_architecture ]; then
+       is_ports_architecture=$(cat /usr/lib/choose-mirror/port_architecture)
 fi
 
 # Ask if a mirror should be used if the base system can be installed from CD
@@ -246,11 +243,42 @@
                ;;
        esac
 
-       echo "deb $protocol://$hostname$directory $codename $dists" > $file
-       if [ -n "${use_unreleased}" ]; then
+       # architectures in the Debian-Ports archive
+       if [ "$codename" = "sid" ] && [ "$is_ports_architecture" = "1" ]; then
+
+               # 'main' is the only component in the Debian-Ports archive
+               echo "deb $protocol://$hostname$directory $codename main" > 
$file
+
+               # sources.list has to include an additional entry for the 
'unreleased' suite.
                echo "deb $protocol://$hostname$directory unreleased main" >> 
$file
+
+               # There are no 'non-free' nor 'contrib' components in the 
Debian-Ports archive.
+               # However some arch-independant packages may be useful (e.g. 
firmwares).
+               # We hardcode a default location on the regular debian mirrors 
as a fallback.
+
+               dists_non_free_contrib=
+
+               for dist in $dists; do
+                       case "$dist" in
+                               "non-free"|"contrib")
+                                       
dists_non_free_contrib="$dists_non_free_contrib $dist"
+                                       ;;
+                               *)
+                                       ;;
+                       esac
+               done
+
+               dists_non_free_contrib="${dists_non_free_contrib# }"
+
+               if [ -n "$dists_non_free_contrib" ]; then
+                       echo "# the 'debian-ports' archive does not support 
'non-free' nor 'contrib' yet" >> $file
+                       echo "deb [ arch=all ] 
$protocol://deb.debian.org/debian $codename $dists_non_free_contrib" >> $file
+               fi
+
+       else # released architectures
+               echo "deb $protocol://$hostname$directory $codename $dists" > 
$file
        fi
-       
+
        if apt-setup-verify --from $PROGRESS_FROM --to $PROGRESS_TO $file; then
                done=1
        else
@@ -273,8 +301,15 @@
        deb_src="# deb-src"
 fi
 
-echo "$deb_src $protocol://$hostname$directory $codename $dists" >> $file
-if [ -n "${use_unreleased}" ]; then
-       echo "# 'unreleased' does not support sources yet" >> $file
-       echo "# $deb_src $protocol://$hostname$directory unreleased main" >> 
$file
+# architectures in the Debian-Ports archive
+if [ "$codename" = "sid" ] && [ "$is_ports_architecture" = "1" ]; then
+
+       # There are no sources (yet !) in the Debian-Ports archive.
+       # We hardcode a default location on the regular debian mirrors as a 
fallback.
+
+       echo "# the 'debian-ports' archive does not support sources yet" >> 
$file
+       echo "$deb_src $protocol://deb.debian.org/debian $codename $dists" >> 
$file
+
+else # released architectures
+       echo "$deb_src $protocol://$hostname$directory $codename $dists" >> 
$file
 fi

Reply via email to