Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apt-mirror/apt-mirror.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Georgiev <310867+chutzimir@users.noreply.github.com>2022-07-05 14:48:45 +0300
committerGeorgi Georgiev <310867+chutzimir@users.noreply.github.com>2022-07-09 06:10:13 +0300
commit3f7f14bb037315d255bb7c36e279e8fd9d5b18f1 (patch)
tree4ff9584f0307dca28ab071882ef98dcca8dff913
parent545c72a0f2e859463d5cd369fff3f52dbb0fdee8 (diff)
Be more explicit about the flat v.s. Debian repository format
These regexes were getting a bit confusing so split the logic into four explicit cases based on: - Repository format is either flat or debian (i.e., has components or not) - Architecture is "source" or something else (binary) All four cases have unique file paths to consider per https://wiki.debian.org/DebianRepository/Format. Specifically, flat repositories only support: - Packages - Sources - InRelease - Release There is also a specific mention that Translations and Contents indices are not defined for flat repositories.
-rwxr-xr-xapt-mirror54
1 files changed, 32 insertions, 22 deletions
diff --git a/apt-mirror b/apt-mirror
index 8facbf1..a5b9241 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -534,6 +534,7 @@ sub find_metadata_in_release
{
if ($component_regex)
{
+ # Debian repository format https://wiki.debian.org/DebianRepository/Format#Debian_Repository_Format
if (
(
$filename =~ m{^${component_regex}/source/Sources${compressed_extension_regex}}
@@ -545,35 +546,44 @@ sub find_metadata_in_release
push @parts_to_download, \@parts;
}
} else {
+ # Flat repository format https://wiki.debian.org/DebianRepository/Format#Flat_Repository_Format
if ($filename =~ m{^Sources${compressed_extension_regex}}
) {
push @parts_to_download, \@parts;
}
}
} else {
- if (
- (
- $filename =~ m{^Contents-${arch_regex}${compressed_extension_regex}}
- ) or (
- $filename =~ m{^Packages${compressed_extension_regex}}
- ) or (
- $filename =~ m{^${component_regex}/Contents-${arch_regex}${compressed_extension_regex}}
- ) or (
- $filename =~ m{^${component_regex}/binary-${arch_regex}/Packages${compressed_extension_regex}}
- ) or (
- $filename =~ m{^${component_regex}/binary-${arch_regex}/Release$}
- ) or (
- $filename =~ m{^${component_regex}/cnf/Commands-${arch_regex}${compressed_extension_regex}}
- ) or (
- $filename =~ m{^${component_regex}/dep11/Components-${arch_regex}.*${compressed_extension_regex}}
- ) or (
- $filename =~ m{^${component_regex}/dep11/icons-.*${compressed_extension_regex}}
- ) or (
- $filename =~ m{^${component_regex}/i18n/Translation-.*${compressed_extension_regex}}
- )
- )
+ if ($component_regex)
{
- push @parts_to_download, \@parts;
+ # Debian repository format https://wiki.debian.org/DebianRepository/Format#Debian_Repository_Format
+ if (
+ (
+ $filename =~ m{^Contents-${arch_regex}${compressed_extension_regex}}
+ ) or (
+ $filename =~ m{^${component_regex}/Contents-${arch_regex}${compressed_extension_regex}}
+ ) or (
+ $filename =~ m{^${component_regex}/binary-${arch_regex}/Packages${compressed_extension_regex}}
+ ) or (
+ $filename =~ m{^${component_regex}/binary-${arch_regex}/Release$}
+ ) or (
+ $filename =~ m{^${component_regex}/cnf/Commands-${arch_regex}${compressed_extension_regex}}
+ ) or (
+ $filename =~ m{^${component_regex}/dep11/Components-${arch_regex}.*${compressed_extension_regex}}
+ ) or (
+ $filename =~ m{^${component_regex}/dep11/icons-.*${compressed_extension_regex}}
+ ) or (
+ $filename =~ m{^${component_regex}/i18n/Translation-.*${compressed_extension_regex}}
+ )
+ )
+ {
+ push @parts_to_download, \@parts;
+ }
+ } else {
+ # Flat repository format https://wiki.debian.org/DebianRepository/Format#Flat_Repository_Format
+ if ($filename =~ m{^Packages${compressed_extension_regex}})
+ {
+ push @parts_to_download, \@parts;
+ }
}
}
}