🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #6894

Bug#435574: debmirror: Please support mirrors without a root directory

#6894
From: Thorsten Glaser
Date: Mon, 30 Nov 2026 17:20
132 lines
8702 bytes
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323328-857843384-1796058102=:740
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: QUOTED-PRINTABLE

tags 435574 + patch
thanks

Hi Colin,

as pre-discussed in IRC, here=E2=80=99s my first version of a patch for
debmirror (git master) to make it work with servers that don=E2=80=99t
accept two leading slashes, trying to not break anything else ;)

The approach is thus:

- first, I changed it so that the $remoteroot is assumed to end
  with a trailing slash everywhere, and added a normalisation RE
  (new line 819 and 821) so that any amount of trailing slashes
  given by the user in -r ROOT or --root=3DROOT (even zero) is
  replaced by exactly one
  =E2=80=A3 all applicable "$remoteroot/" are now "$remoteroot"

- I also changed the default value and the documentation thereof
  so that using --root=3D/ for subdirectory-less servers is hopefully
  natural to users, as Getopt::Long unfortunately does not make it
  possible to allow --root=3D (it *does* allow -r '')
  =E2=80=A3 hmu (or change it yourself) if you think that this needs some
    more elaboration
  =E2=80=A3 I also changed this in the example file but without adding a
    comment there for empty root; in theory, users setting=E2=80=A6
=09$remoteroot=3D"";
    =E2=80=A6 should work the same as=E2=80=A6
=09$remoteroot=3D"/";
    =E2=80=A6 but I only tested command-line usage

- as a consequence of this, the FTP login path got an extra local
  variable that has a leading slash but no trailing slash; FTP chdir
  for subdirectory-less servers will now do 'cd /' as well, just one
  slash, and for others, 'cd /debian' etc. as before

This brings us to a situation in which no extra *trailing* slashes
are added anywhere. Now we need to collapse the slash after the
hostname (if any) with the normalised-one trailing slash of $remoteroot

- add a new variable $remoteslashroot which is initialised to the same
  value as $remoteroot (after removing the optional prefix), but with
  a leading slash added; $remoteroot and $remoteslashroot then have the
  trailing slashes normalised *individually* so that the leading slash
  is collapsed with the trailing ones for subdirectory-less servers

- change all places where we have "/$remoteroot" to "$remoteslashroot"

I=E2=80=99m a bit wary of the rsync block from new line 1000 onwards. I cha=
nged
the length condition to make up for the newly enforced trailing slash,
but this means subdirectory-less servers will end up in the else branch
still, where if (downloads_via_rsync()) dies (I am not familiar with all
the various codepaths and ways debmirror can download things). This
should not *break* anything, but it doesn=E2=80=99t fix anything either.

A full run of the following command does succeed (and only downloads a
couple of hundred KiB):

=09debmirror --method=3Dhttp -v -p -h apt.puppetlabs.com -r '' \
=09    -d trusty -s dependencies --no-check-gpg foo

I=E2=80=99d be glad if you could review this and, if you think it=E2=80=99s=
 okay,
include with new debmirror releases.

Thanks,
//Thorsten
--=20
Thorsten Glaser
Linux / Unix Developer
Tel.: +49 160 91168501
E-Mail: tglaser@b1-systems.de

B1 Systems GmbH
Osterfeldstra=C3=9Fe 7 / 85088 Vohburg / https://www.b1-systems.de/
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt, HRB 3537
--8323328-857843384-1796058102=:740
Content-Type: application/gzip; name=debmirror-435574.diff.gz
Content-Transfer-Encoding: BASE64
Content-ID: <f19dad04-36ca-5b90-35aa-7ff7e1ceee90@b1-systems.de>
Content-Description: 
Content-Disposition: attachment; filename=debmirror-435574.diff.gz

H4sIAAAAAAACA61XW2/bxhJ+56+YsjIqVaJE6mZJDgWnNXJOH5oTIC4QoG6F
FbmUtiG57C5lRUjd396ZJUWRjtTLaQjDpGZ2Z+fyzWVfKZlANB8F4+F0Pr2e
jLg7YbPRNZvOo9HYG7H5jE1HfD4aD70QvpcpvOUZeNfgugvzB0PX9axXKGYB
91updM5T+E/MNFfwIt+Yj9u15+gDchLdD/nSumM5X5CwHoxceC0fUchwilIX
w+nCm0PX9VzXertb/8KDfAE/vnl5/+1/f4JM8VgkImXqABnLgy1EUkHCULCy
LMdxLAj5OhFKIbn5/AbDGXSfP87psYB/YEkWcz2oZPQDmUa4FYbQxQVDiATy
IdiydMPDHngzECmalwuZ6na3g5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Du0
ziy6o4bwbI1pErSEwD+fYgl0oTufzstSiM0D5wWB+Jdpij0Eh4QCucZ59JTu
K2eW5ABXMsNO5kP7jtIA/GWZED14g6mA/c6QsuK7B/dFhTbEslofww7QRnkt
henj1+tlpywaraurm+PBLaz6/mueLxav7t84y5Tv28ZrvUKfDmCBCgUHu3X7
QH2lts1ZxnKDDjEO7x1b1GmH4UKExY+H9g2WlSqPm1LWxZR33IbjS2zKDdaq
HEomtRNqePV9wT5sN2vy6WzkEVzq3EqTo5OaUvbh2e34Ue1raI3Twrb98PXb
+7v//XCP0R+OXbdjyhgWyI3CGnzTiLfi+U6lJV7mQ1Ms5/NZWSyfYYValqnp
IUflcQxuNhjqGkof0oB6S6ojrtClJuRELFais6hKxjzd5NsmCj5a3fMsWILX
OYHyXJ0tGmpVZ+tP/XRql42Errz+t9afnF35r5Yzf30yIfhh8bD4xyqc2VjX
pe4XA3ucGeCrCtdfNZz3l4eVhbZGPnfWUzn3Hwd/rxwvL0eXXNYsL+ciaY69
EEqTBAXCApZSLq7NOBDiUI3nsWrErzvY1Ifu5xBVrzRFt8FsMF6YeSPjhZk3
L7xAhTbD7pCvMo5TdpqT0USkgWC14XnhhOOkgX73jGjKFsKyr7ciyk1lIdJO
xb59rql8JGQ84fukJf0iEU+F2X9j+3F31YueThJKnbBMmJsC/TZ2EU5UTGXe
rg9Jjcvmpevs+hKnvIhG4ZSNrmf9Phak+XQ2povodDwuL6KX9hbX0ktcCtPQ
BMn8p0HQqEy3hst3n3P3ngt3ngv3nUt3nYv3nJZMsObqHd7qVvqQ4IT+XhdK
6vciy/CegpdoQ0FvWMP++Lo/sqw/ABc5ogtEEQAA

--8323328-857843384-1796058102=:740--
Technical Details
Message-ID: <O5dcK-f9S8-13@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <O5dcK-f9S8-15@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Thorsten Glaser <tglaser@b1-systems.de>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#435574: debmirror: Please support mirrors without a root directory
Date: Mon, 30 Nov 2026 18:20:02 +0100
Message-ID: <O5dcK-f9S8-13@gated-at.bofh.it>
References: <O5dcK-f9S8-15@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 30 17:11:07 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.451
Reply-To: Thorsten Glaser <tglaser@b1-systems.de>, 435574@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: cjwatson@debian.org
X-Debian-Pr-Message: followup 435574
X-Debian-Pr-Package: debmirror
X-Debian-Pr-Source: debmirror
X-Ms-Reactions: disallow
X-Zitierstil: Wir wechseln gerne von TOFU auf den Usenet-Zitierstandard; sprechen Sie uns einfach an!
X-Quoting-Style: We will gladly switch from top-posting to Usenet standard quoting style; please just ask!
Content-Language: ksh-Latn-DE-u-ca-iso8601-co-POSIX-kk-false-em-text-rg-denw-tz-utc-va-posix, de-DE-1901-u-ca-iso8601-co-POSIX-kk-false-em-text-rg-denw-tz-utc-va-posix, de-Latf-DE-1901-u-ca-iso8601-co-POSIX-kk-false-em-text-rg-denw-tz-utc-va-posix, en-GB-u-ca-iso8601-fw-mon-hc-h23-co-POSIX-kk-false-cu-eur-em-text-rg-denw-ms-metric-mu-celsius-tz-utc-va-posix, und-Zsym-u-ca-iso8601-fw-mon-hc-h23-co-POSIX-kk-false-cu-eur-em-text-rg-denw-ms-metric-mu-celsius-tz-utc-va-posix
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323328-857843384-1796058102=:740"
X-Greylist: delayed 379 seconds by postgrey-1.37 at buxtehude; Mon, 30 Nov 2026 17:08:05 UTC
X-Crossassassin-Score: 2
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2006111
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 132
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 30 Nov 2026 18:01:41 +0100 (CET)
X-Original-Message-ID: <f7af38c4-27ce-76d4-1d1d-9f59e8e1185f@b1-systems.de>
X-Original-References: <20070801180833.17590.51373.reportbug@localhost.localdomain>