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

github.com/Stifler6996/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-07 05:34:17 +0300
committerGeorgi Georgiev <310867+chutzimir@users.noreply.github.com>2022-07-07 05:34:17 +0300
commit0d4c272e4ff06ba0e941b730d58a86f332381f80 (patch)
treeb2ec9d5a004daeec3f64e6f9855ba1b793d5661c
parent87cbcd203a5e77c3867cf4f6a9e4db00ae3005a4 (diff)
Support repositories without Release files
This allows to mirror a repo like ``` deb https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64/ / ``` which has an `InRelease` file, but no `Release` file.
-rwxr-xr-xapt-mirror19
1 files changed, 14 insertions, 5 deletions
diff --git a/apt-mirror b/apt-mirror
index 0c52b0b..1fe8edd 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -514,19 +514,27 @@ sub find_metadata_in_release
else {
$dist_uri = remove_double_slashes($uri . "/" . $distribution . "/");
}
- $release_uri = $dist_uri . "Release";
- $release_path = get_variable("skel_path") . "/" . sanitise_uri($release_uri);
- unless ( open STREAM, "<$release_path" )
+ my $stream;
+ foreach my $release_filename ("InRelease", "Release")
{
- warn( "Failed to open Release file from " . $release_uri );
+ $release_uri = $dist_uri . $release_filename;
+ $release_path = get_variable("skel_path") . "/" . sanitise_uri($release_uri);
+
+ last if ( open $stream, "<", $release_path);
+ $stream = undef;
+ }
+
+ unless ( $stream )
+ {
+ warn( "Failed to find InRelease or Release in " . get_variable("skel_path") . "/" . sanitise_uri($dist_uri) );
return;
}
my $checksums = 0;
my $acquire_by_hash = 0;
my @parts_to_download = ();
- while ( $line = <STREAM> )
+ while ( $line = <$stream> )
{
chomp $line;
if ($checksums)
@@ -606,6 +614,7 @@ sub find_metadata_in_release
}
}
}
+ close $stream;
foreach (@parts_to_download)
{
my ( $sha256, $size, $filename ) = @{$_};