#! /bin/sh /usr/share/dpatch/dpatch-run ## 01_mirror_bz2_files_too.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Should also mirror bz2 files even though they are not used @DPATCH@ === apt-mirror/apt-mirror ================================================================== --- apt-mirror/apt-mirror (revision 82) +++ apt-mirror/apt-mirror (local) @@ -286,9 +286,11 @@ foreach (@components) { add_url_to_download($url . $_ . "/source/Release"); add_url_to_download($url . $_ . "/source/Sources.gz"); + add_url_to_download($url . $_ . "/source/Sources.bz2"); } } else { add_url_to_download($uri . "/$distribution/Sources.gz"); + add_url_to_download($uri . "/$distribution/Sources.bz2"); } } @@ -300,13 +302,18 @@ add_url_to_download($url . "Release"); add_url_to_download($url . "Release.gpg"); - add_url_to_download($url . "Contents-" . $arch . ".gz") if get_variable("_contents"); + if (get_variable("_contents")) { + add_url_to_download($url . "Contents-" . $arch . ".gz"); + add_url_to_download($url . "Contents-" . $arch . ".bz2"); + } foreach (@components) { add_url_to_download($url . $_ . "/binary-" . $arch . "/Release"); add_url_to_download($url . $_ . "/binary-" . $arch . "/Packages.gz"); + add_url_to_download($url . $_ . "/binary-" . $arch . "/Packages.bz2"); } } else { add_url_to_download($uri . "/$distribution/Packages.gz"); + add_url_to_download($uri . "/$distribution/Packages.bz2"); } } @@ -319,6 +326,7 @@ s[~][%7E]g if get_variable("_tilde"); $skipclean{$_} = 1; $skipclean{$_} = 1 if s[\.gz$][]; + $skipclean{$_} = 1 if s[\.bz2$][]; } ###################################################################################### @@ -490,6 +498,7 @@ die("apt-mirror: invalid url in index_urls") unless s[^(\w+)://][]; copy_file(get_variable("skel_path") . "/$_", get_variable("mirror_path") . "/$_"); copy_file(get_variable("skel_path") . "/$_", get_variable("mirror_path") . "/$_") if(s/\.gz$//); + copy_file(get_variable("skel_path") . "/$_", get_variable("mirror_path") . "/$_") if(s/\.bz2$//); }