Package: debmirror
Version: 1:2.47
Tags: patch

The current Version of debmirror has a lot of Problems when attempting to 
mirror Custom Repositories.

Please keep in Mind that I'm not a PERL Developer so all the Modifications are 
best guesses based on the current Code and some Examples that I could find 
online. It is by no means super accurate in terms of indentation, variable 
names, code style, etc.
There are furthermore some verbose/debug Messages that are currently a bit 
messy (not very pretty), since I had to identify e.g. the full URL or File Path 
that the File was being downloaded from/to. This might need to be better 
cleaned up in an official (upstreamed) Revision.

I cloned the original Repository from 
https://salsa.debian.org/debian/debmirror, then I uploaded my modifications and 
some Examples at 
https://github.com/luckylinux/debmirror/tree/custom_mirrors_better_support 
(Branch: custom_mirrors_better_support).

I also provided quite a few Examples of BASH Scripts invoking debmirror 
Command, which can be tested against the current Upstream Release: 
https://github.com/luckylinux/debmirror/tree/custom_mirrors_better_support/examples_custom_repositories.

I cannot remember exactly which Repositories had Issues, but I'd say it's 
roughly 30-50% of those Examples that had Issues.

Nevertheless, both the Examples as well as the Repositories themselves, can be 
used as a "test Case" for e.g. some Automated Testing in the Future (if 
somebody can/wants to set that up).

As indicated in the README.md File of the Repository, Issues include Customs 
Repositories featuring:

- Flat Repository Structure
- Abscence of dists/ in the URL Path (also when Repository Structure isn't 
itself flat)
- GPG Issues with Release.gpg / Release, whereas InRelease works correctly
- Specify a custom User Agent (needed in particular for those Repositories 
on/behind Cloudflare that would otherwise get blocked)
- codename not matching dist in Packages / Release Files
- ...

There could be a few extra Issues that I forgot to explicitly List but that I 
already fixed in the Code.

Notes (found after modifying the Code):

- The Argument --keyring: since multiple Values didn't seem to work the first 
Time I tried, I also implemented a --keyring=key1,key2 (comma sepated List), 
which could potentially be avoided since now, after another attempt, 
--keyring=key1 --keyring=key2 seemed to work.
- The Upstream master Branch IIRC is now on Version 2.49 (this patch was based 
on the debmirror Script/Executable installed on Debian Trixie, i.e. Version 
2.47)
- On https://salsa.debian.org/debian/debmirror there seems to be a Branch 
(flat_repo_support) that might already be adding Support for Flat Repositories. 
Unsure if the Support is complete since I discovered it afterwards.

There were a lot of Edge Cases (as mentioned above), so if you don't think that 
those modifications are needed, please test each example Case that I provided 
at 
https://github.com/luckylinux/debmirror/tree/custom_mirrors_better_support/examples_custom_repositories.
 It could be that a newer Version of debmirror (in the master Branch) already 
behaves correctly or I used some Command Line Options in a Way that is not 
correct.

Unfortunately I don't have a lot of free Time to dedicate into maturing all of 
this into the quality probably required to be up-streamed.

Nevertheless I believe that it would be beneficial to share my Modifications, 
since they could be useful for many other Users in similar Situations.

I'll try to follow up on this and help the community, however I believe that 
the proper patching / addition of Features is better done by the upstream 
Maintainer (or somebody already contributing to the Project and with a better 
knowledge of PERL compared to me).

Kind Regards,
luckylinux.

Reply via email to