diff options
author | Rafe Colton <rafecolton@users.noreply.github.com> | 2021-02-07 04:51:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-07 04:51:32 +0300 |
commit | 0611b5ab7d5b15cd9ab24b1dfdfb1a1125ecb6cd (patch) | |
tree | 1c59002e0314ea189743dc07b88504dee6813612 | |
parent | 1ebf610c30c17a10abc6b5c4501ded5ad433253b (diff) |
Account for sources that do not have a distribution or component (#2)
Add support for basic source repositories that do not have component or distribution sections.
-rwxr-xr-x | apt-mirror | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -288,7 +288,7 @@ sub download_urls sub parse_config_line { - my $pattern_deb_line = qr/^[\t ]*(?<type>deb-src|deb)(?:-(?<arch>[\w\-]+))?[\t ]+(?:\[(?<options>[^\]]+)\][\t ]+)?(?<uri>[^\s]+)[\t ]+(?<components>.+)$/; + my $pattern_deb_line = qr/^[\t ]*(?<type>deb-src|deb)(?:-(?<arch>[\w\-]+))?[\t ]+(?:\[(?<options>[^\]]+)\][\t ]+)?(?<uri>[^\s]+)[\t ]?(?<components>.*)$/; my $line = $_; my %config; if ( $line =~ $pattern_deb_line ) { @@ -452,7 +452,7 @@ foreach (@config_binaries) add_url_to_download( $url . $_ . "/cnf/Commands-" . $arch . ".xz" ); } } - else + elsif ($distribution) { add_url_to_download( $uri . "/$distribution/Release" ); add_url_to_download( $uri . "/$distribution/Release.gpg" ); @@ -460,6 +460,14 @@ foreach (@config_binaries) add_url_to_download( $uri . "/$distribution/Packages.bz2" ); add_url_to_download( $uri . "/$distribution/Packages.xz" ); } + else + { + add_url_to_download( $uri . "/Release" ); + add_url_to_download( $uri . "/Release.gpg" ); + add_url_to_download( $uri . "/Packages.gz" ); + add_url_to_download( $uri . "/Packages.bz2" ); + add_url_to_download( $uri . "/Packages.xz" ); + } } chdir get_variable("skel_path") or die("apt-mirror: can't chdir to skel"); @@ -880,10 +888,14 @@ foreach (@config_binaries) process_index( $uri, "/dists/$distribution/$component/binary-$arch/Packages" ); } } - else + elsif ($distribution) { process_index( $uri, "/$distribution/Packages" ); } + else + { + process_index( $uri, "/Packages" ); + } } clear_stat_cache(); |