[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#973852: Debootstrap with mirror_style 'main' fails



Package: debootstrap

Version: 1.0.114

I have a local Debian Mirror organized with mirror_style 'main'.  I've
used this setup for years.

Using this mirror under buster, debootstrap fails with the error
message

    E: Couldn't download

The error message is generated by the shell function

    download_main ()

in the file

    /usr/share/debootstrap/functions

at line 911.  The cause is line 885 in the same function

    for p in "$@"; do

The double quotes cause the list of packages to be seen as a single
item.  The for loop iterates only once with the value of p containing
the entire space-separated list of packages.

The fix is to remove the double quotes.  I've have tried this fix and
it works.  The for loop then iterates over each package separately.

The bug was introduced when line 425 in 1.0.89

    "$DOWNLOAD_DEBS" $(echo "$@" | tr ' ' '\n' | sort)

was replaced with (at line 484 in 1.0.114)

    "$DOWNLOAD_DEBS" "$(echo "$@" | tr ' ' '\n' | sort)"

Note the addition of double quotes in the newer version.  The for loop
line is the same in both versions.  In 1.0.89, DOWNLOAD_DEBS is
called with many arguments.  In 1.0.114, it has just one.

The value of $DOWNLOAD_DEBS could refer to either the

    download_main      or
    download_release

function corresponding to the mirror_styles 'main' and 'release'.  In
the 'release' case, the new version works fine(*).  I suspect the bug
only appears in the less common 'main' case.  That is why I don't
suggest reverting the function calling site and instead altered the
for loop in the function download_main.

In my setup, I call debootstrap as follows:

    /usr/sbin/debootstrap                                 \
      --verbose                                           \
         --variant=minbase                                \
            --arch=amd64                                  \
      --components=main                                   \
      buster                                              \
      /mnt/impromptu/Tigris                               \
      file:///srv/digital_content/debian_mirrors/buster/  \
      /usr/share/debootstrap/scripts/buster_main


The debootstrap script is simply the buster script with mirror_style
main instead of release.

    cd /usr/share/debootstrap/scripts/
    diff buster_main buster
    1c1
    < mirror_style main
    ---
    > mirror_style release


Thanks for your attention,

Tim Connors

Tim.Connors@RanchoSoquel.net

(*) This how I recently re-populated the local mirror from
    mirrors.kernel.org.


Reply to: