From 67c4e1e424e081fa0cd77c97ce7a9d82053f6bb5 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 3 Mar 2006 00:54:09 +0000 Subject: [PATCH] - Fix some issues with non-US handling - volatile and backports are archives, partly revert a earlier patch that accidently removed that - after that we can clean-up some ftp_site handling code (except for some ugly non-US hacks) - add kfreebsd-amd64 --- cgi-bin/dispatcher.pl | 4 ++++ config.sh | 6 +++--- cron.d/100syncarchive_backports | 10 +++++----- cron.d/100syncarchive_kfreebsd | 24 +++++++++++++----------- cron.d/100syncarchive_volatile | 8 ++++---- lib/Packages/DoDownload.pm | 9 ++++++--- lib/Packages/DoShow.pm | 16 +++------------- lib/Packages/HTML.pm | 15 ++++----------- 8 files changed, 42 insertions(+), 50 deletions(-) diff --git a/cgi-bin/dispatcher.pl b/cgi-bin/dispatcher.pl index 50a92f6..6235cc5 100755 --- a/cgi-bin/dispatcher.pl +++ b/cgi-bin/dispatcher.pl @@ -118,6 +118,7 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) { my %params_set; sub set_param_once { my ($cgi, $params_set, $key, $val) = @_; + debug("set_param_once key=$key val=$val",4) if DEBUG; if ($params_set->{$key}++) { fatal_error( sprintf( _g( "%s set more than once in path" ), $key ) ); } else { @@ -129,6 +130,7 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) { foreach (reverse @components) { $need_pkg = !@pkg && ($what_to_do !~ /^(index|allpackages|newpkg)$/); + debug("need_pkg=$need_pkg component=$_",4) if DEBUG; if (!$need_pkg && $SUITES{$_}) { set_param_once( $input, \%params_set, 'suite', $_); } elsif (!$need_pkg && (my $s = $SUITES_ALIAS{$_})) { @@ -139,6 +141,8 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) { set_param_once( $input, \%params_set, 'archive', $_); } elsif (!$need_pkg && $sections_descs{$_}) { set_param_once( $input, \%params_set, 'subsection', $_); + } elsif (!$need_pkg && ($_ eq 'non-us')) { # non-US hack + set_param_once( $input, \%params_set, 'subsection', 'non-US'); } elsif (!$need_pkg && ($_ eq 'source')) { set_param_once( $input, \%params_set, 'source', 1); } elsif ($ARCHITECTURES{$_}) { diff --git a/config.sh b/config.sh index 299c539..eab1b2b 100644 --- a/config.sh +++ b/config.sh @@ -48,16 +48,16 @@ cn_help_url="http://www.debian.org/intro/cn" # polangs="de fi nl fr uk" ddtplangs="de cs da eo es fi fr hu it ja nl pl pt_BR pt_PT ru sk sv_SE uk" -archives="us non-US security amd64 kfreebsd" +archives="us non-US security amd64 kfreebsd backports volatile" sections="main contrib non-free" parts="$sections" suites="oldstable stable stable-volatile stable-backports testing unstable experimental" dists="$suites" -architectures="alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc s390 sparc" +architectures="alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc" arch_oldstable="alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc" arch_stable="${arch_oldstable} amd64" arch_testing="${arch_stable}" -arch_unstable="${arch_stable} hurd-i386 kfreebsd-i386" +arch_unstable="${arch_stable} hurd-i386 kfreebsd-i386 kfreebsd-amd64" arch_experimental="${arch_unstable}" arch_testing_proposed_updates="${arch_testing}" arch_stable_proposed_updates="${arch_stable}" diff --git a/cron.d/100syncarchive_backports b/cron.d/100syncarchive_backports index b482dc7..fef94c2 100755 --- a/cron.d/100syncarchive_backports +++ b/cron.d/100syncarchive_backports @@ -15,19 +15,19 @@ do for part in ${parts} do echo retrieve Packages $dist-backports/$part/$arch - test -d us/${dist}-backports/${part}/binary-${arch} || mkdir -p us/${dist}-backports/${part}/binary-${arch} - (cd us/${dist}-backports/${part}/binary-${arch} && + test -d backports/${dist}-backports/${part}/binary-${arch} || mkdir -p backports/${dist}-backports/${part}/binary-${arch} + (cd backports/${dist}-backports/${part}/binary-${arch} && wget -q -N ${backports_ftpsite}/dists/sarge-backports/${part}/binary-${arch}/Packages.gz) done echo retrieve Contents $dist-backports/$arch - (cd us/${dist}-backports && + (cd backports/${dist}-backports && wget -q -N ${backports_ftpsite}/dists/sarge-backports/Contents-${arch}.gz) done for part in ${parts} do echo retrieve Sources $dist-backports/$part - test -d us/${dist}-backports/${part}/source || mkdir -p us/${dist}-backports/${part}/source - (cd us/${dist}-backports/${part}/source && + test -d backports/${dist}-backports/${part}/source || mkdir -p backports/${dist}-backports/${part}/source + (cd backports/${dist}-backports/${part}/source && wget -q -N ${backports_ftpsite}/dists/sarge-backports/${part}/source/Sources.gz) done done diff --git a/cron.d/100syncarchive_kfreebsd b/cron.d/100syncarchive_kfreebsd index dff6cd2..85160dc 100755 --- a/cron.d/100syncarchive_kfreebsd +++ b/cron.d/100syncarchive_kfreebsd @@ -7,19 +7,21 @@ cd ${archivedir} # Main archive # -arch=kfreebsd-i386 +architectures="kfreebsd-i386 kfreebsd-amd64" -for dist in unstable experimental +for arch in $architectures do - for part in ${parts} main/debian-installer + for dist in unstable experimental do - echo retrieve Packages $dist/$part/$arch - test -d kfreebsd/${dist}/${part}/binary-${arch} || mkdir -p kfreebsd/${dist}/${part}/binary-${arch} - (cd kfreebsd/${dist}/${part}/binary-${arch} && - wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) + for part in ${parts} main/debian-installer + do + echo retrieve Packages $dist/$part/$arch + test -d kfreebsd/${dist}/${part}/binary-${arch} || mkdir -p kfreebsd/${dist}/${part}/binary-${arch} + (cd kfreebsd/${dist}/${part}/binary-${arch} && + wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/${part}/binary-${arch}/Packages.gz) + done + echo retrieve Contents $dist/$arch + (cd kfreebsd/${dist} && + wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/Contents-${arch}.gz) done - echo retrieve Contents $dist/$arch - (cd kfreebsd/${dist} && - wget -q -N ${kfreebsd_ftpsite}/dists/${dist}/Contents-${arch}.gz) done - diff --git a/cron.d/100syncarchive_volatile b/cron.d/100syncarchive_volatile index 9fa2366..44bb5c9 100755 --- a/cron.d/100syncarchive_volatile +++ b/cron.d/100syncarchive_volatile @@ -15,16 +15,16 @@ do for part in ${parts} do echo retrieve Packages $dist-volatile/$part/$arch - test -d us/${dist}-volatile/${part}/binary-${arch} || mkdir -p us/${dist}-volatile/${part}/binary-${arch} - (cd us/${dist}-volatile/${part}/binary-${arch} && + test -d volatile/${dist}-volatile/${part}/binary-${arch} || mkdir -p volatile/${dist}-volatile/${part}/binary-${arch} + (cd volatile/${dist}-volatile/${part}/binary-${arch} && wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/binary-${arch}/Packages.gz) done done for part in ${parts} do echo retrieve Sources $dist-volatile/$part - test -d us/${dist}-volatile/${part}/source || mkdir -p us/${dist}-volatile/${part}/source - (cd us/${dist}-volatile/$part/source && + test -d volatile/${dist}-volatile/${part}/source || mkdir -p volatile/${dist}-volatile/${part}/source + (cd volatile/${dist}-volatile/$part/source && wget -q -N ${volatile_ftpsite}/dists/${dist}/volatile/${part}/source/Sources.gz) done done diff --git a/lib/Packages/DoDownload.pm b/lib/Packages/DoDownload.pm index c90eef1..89da639 100644 --- a/lib/Packages/DoDownload.pm +++ b/lib/Packages/DoDownload.pm @@ -305,14 +305,17 @@ sub do_download { $$page_content .= '

'._g( 'Note that GNU/kFreeBSD is not officialy included in the Debian archive yet, but the GNU/kFreeBSD porter group keeps their archive in sync with the official archive as close as possible. See the GNU/kFreeBSD ports page for current information.' ).'

'; } elsif ($archive eq 'non-US') { + $$page_content .= '
'; $$page_content .= print_links( _g( "North America" ), $file, @nonus_north_american_sites ); - $$page_content .= print_links( _g( "Europe" ), $file, @nonus_european_sites ); $$page_content .= print_links( _g( "Australia and New Zealand" ), $file, @nonus_australian_sites ); $$page_content .= print_links( _g( "Asia" ), $file, @nonus_asian_sites ); $$page_content .= print_links( _g( "South America" ), $file, @nonus_south_american_sites ); - - $$page_content .= '

'.sprintf( _g('If none of the above sites are fast enough for you, please see our complete mirror list.' ), 'http://www.debian.org/mirror/list-non-US' ).'

'; + $$page_content .= '
'; + $$page_content .= print_links( _g( "Europe" ), $file, @nonus_european_sites ); + $$page_content .= '
'; + + $$page_content .= '

'.sprintf( _g('If none of the above sites are fast enough for you, please see our complete mirror list.' ), 'http://www.debian.org/mirror/list-non-US' ).'

'; } elsif ($archive eq 'backports') { $$page_content .= '
'; diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index 1261544..1f0beb0 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -382,19 +382,9 @@ sub do_show { foreach( @$source_files ) { my ($src_file_md5, $src_file_size, $src_file_name) = split /\s+/, $_; - my $src_url; - for ("$suite/$archive") { - /security/o && do { - $src_url = $FTP_SITES{security}; last }; - /volatile/o && do { - $src_url = $FTP_SITES{volatile}; last }; - /backports/o && do { - - $src_url = $FTP_SITES{backports}; last }; - /non-us/io && do { - $src_url = $FTP_SITES{'non-US'}; last }; - $src_url = $FTP_SITES{us}; - } + (my $server = lc $archive) =~ s/-//go; # non-US hack + my $src_url = $FTP_SITES{$server} + || $FTP_SITES{us}; $src_url .= "/$source_dir/$src_file_name"; $package_page .= "$src_file_name\n" diff --git a/lib/Packages/HTML.pm b/lib/Packages/HTML.pm index fb16d2f..dca294e 100644 --- a/lib/Packages/HTML.pm +++ b/lib/Packages/HTML.pm @@ -136,17 +136,10 @@ sub pmoreinfo { } else { foreach( @$files ) { my ($src_file_md5, $src_file_size, $src_file_name) = split /\s/o, $_; - for ("$suite/".$page->get_newest('archive')) { - /security/o && do { - $str .= "{security}/$src_dir/$src_file_name\">["; last }; - /volatile/o && do { - $str .= "{volatile}/$src_dir/$src_file_name\">["; last }; - /backports/o && do { - $str .= "{backports}/$src_dir/$src_file_name\">["; last }; - /non-us/io && do { - $str .= "{'non-US'}/$src_dir/$src_file_name\">["; last }; - $str .= "{us}/$src_dir/$src_file_name\">["; - } + # non-US hack + (my $server = lc $page->get_newest('archive')) =~ s/-//go; + $str .= sprintf("[", + $env->{$server}||$env->{us}); if ($src_file_name =~ /dsc$/) { $str .= "dsc"; } else { -- 2.39.2