🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#6898
From: Adam
Date: Mon, 30 Nov 2026 18:00
81 lines
4505 bytes
Package: debmirror
Version: 1:2.47+deb13u1
Followup-For: Bug #435574

Dear Maintainer,

I found that the Hashicorp apt repo puts its repo in the root directory
and that debmirror can't handle that. Specifying --root=/ results in a
double slash in the URL, which fails to fetch the Release file.  Perl
does not normalize the path, nor does their web server.

It took me a while to figure this out because browsers, curl, wget, and
Python (requests library) all do seem to normalize the URL path before
sending the request, so it looks like having a double slash isn't a
problem when testing.

Steps to reproduce this error:

# Get the key
curl https://apt.releases.hashicorp.com/gpg > ../hashicorp.asc
gpg --dearmor -o ../hashicorp.gpg ../hashicorp.asc

# Try to mirror
/usr/bin/debmirror --method=https --host=apt.releases.hashicorp.com \
--root=/ --dist=trixie --section=main --arch=amd64 --nosource \
--keyring=../hashicorp.gpg --progress --rsync-extra=none .

I'm also including a patch to fix this issue, which I've tested using
the above commands and regression tested using the Smallstep apt repo.

--- debmirror     2026-11-30 09:36:51.040536217 -0600
+++ debmirror     2026-11-30 09:38:10.004952090 -0600
@@ -1813,7 +1813,7 @@
  sub http_get {
    local $| = 1;
    my $file=shift;
-  my $url="$download_method://${host}/${remoteroot}/${file}";
+  my $url = "$download_method://${host}/" . ($remoteroot=="/" ? "" : 
"$remoteroot/") .  $file;
    my $ret=1;

    print "$url => " if $debug;


Finally, I checked the source code for 2.49 and verified this issue is
still present in that version.


-- System Information:
Debian Release: 13.8
   APT prefers stable-updates
   APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.48+deb13-amd64 (SMP w/1 CPU thread; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE 
not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages debmirror depends on:
ii  bzip2                    1.0.8-6
pn  libdigest-md5-perl       <none>
pn  libdigest-sha-perl       <none>
ii  liblockfile-simple-perl  0.208-1.1
ii  libwww-perl              6.78-1+deb13u1
ii  perl [libnet-perl]       5.40.1-6+deb13u1
ii  rsync                    3.5.0+ds1-0+deb13u2
ii  xz-utils                 5.8.1-1+deb13u2

Versions of packages debmirror recommends:
ii  ed     1.21.1-1
ii  gpgv   2.4.7-21+deb13u1+b5
ii  patch  2.8-2+deb13u1

Versions of packages debmirror suggests:
ii  gnupg  2.4.7-21+deb13u1

-- no debconf information
Technical Details
Message-ID: <O5dPr-fa9N-17@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!news.servidellagleba.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-fra.pugleaf.net!srl.newsdeef.eu!news.corradoroberto.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From: Adam <debian@hax0rbana.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#435574: debmirror: Please support mirrors without a root directory
Date: Mon, 30 Nov 2026 19:00:01 +0100
Message-ID: <O5dPr-fa9N-17@gated-at.bofh.it>
References: <O5dcK-f9S8-15@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <435574@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 30 17:53:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.651
Reply-To: Adam <debian@hax0rbana.org>, 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-Keywords: patch
X-Debian-Pr-Source: debmirror
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: delayed 399 seconds by postgrey-1.37 at buxtehude; Mon, 30 Nov 2026 17:51:21 UTC
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2006119
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 81
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 30 Nov 2026 11:44:30 -0600
X-Original-Message-ID: <111d0adb-4bb4-4532-8a51-0486d6541c3a@hax0rbana.org>
X-Original-References: <20070801180833.17590.51373.reportbug@localhost.localdomain>